JP5682065B2 - Stereo image processing apparatus and stereo image processing method - Google Patents

Stereo image processing apparatus and stereo image processing method Download PDF

Info

Publication number
JP5682065B2
JP5682065B2 JP2011045223A JP2011045223A JP5682065B2 JP 5682065 B2 JP5682065 B2 JP 5682065B2 JP 2011045223 A JP2011045223 A JP 2011045223A JP 2011045223 A JP2011045223 A JP 2011045223A JP 5682065 B2 JP5682065 B2 JP 5682065B2
Authority
JP
Japan
Prior art keywords
cost
image
window
cumulative addition
parallax
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2011045223A
Other languages
Japanese (ja)
Other versions
JP2012181142A (en
Inventor
竜一 高瀬
竜一 高瀬
富田 文明
文明 富田
河井 良浩
良浩 河井
吉見 隆
隆 吉見
卓郎 西
卓郎 西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
National Institute of Advanced Industrial Science and Technology AIST
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 National Institute of Advanced Industrial Science and Technology AIST filed Critical National Institute of Advanced Industrial Science and Technology AIST
Priority to JP2011045223A priority Critical patent/JP5682065B2/en
Publication of JP2012181142A publication Critical patent/JP2012181142A/en
Application granted granted Critical
Publication of JP5682065B2 publication Critical patent/JP5682065B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、2台以上のカメラで同一の対象物の基準画像と参照画像とを撮影し、これらの画像の対応点をエピポーラ線上で探索して、その対応点のずれを示す視差データを算出するものであって、2枚の画像の画素それぞれを相互に対応付けて2台のカメラの対象物に対する視差を画素ごとに求めるステレオ画像処理装置に関する。   In the present invention, a standard image and a reference image of the same object are photographed by two or more cameras, corresponding points of these images are searched on an epipolar line, and parallax data indicating a deviation of the corresponding points is calculated. The present invention relates to a stereo image processing apparatus that associates each pixel of two images with each other and obtains a parallax with respect to an object of two cameras for each pixel.

現在、さまざまな分野において複数のカメラを用いた3次元計測システムが利用されている。計測対象物を複数のカメラで撮影し、撮影された画像間の視差を検出し、これにより、対象物までの距離を算出するようにしている。一般的には、2つのカメラからの画像信号の輝度を比較することで、2つの画像信号が最も類似する位置を求めている。   Currently, three-dimensional measurement systems using a plurality of cameras are used in various fields. The measurement object is photographed by a plurality of cameras, and the parallax between the photographed images is detected, thereby calculating the distance to the object. In general, by comparing the luminance of image signals from two cameras, a position where the two image signals are most similar is obtained.

また、計測の精度を向上するために、先験的な知識が利用されている。その一つは、物体の表面は連続しているので、カメラによって観測される物体表面の奥行き情報も連続することが期待できるというものである。この知識を計測のアルゴリズムに反映させるいくつかの手法が提案されている。   In addition, a priori knowledge is used to improve measurement accuracy. One is that since the surface of the object is continuous, the depth information of the object surface observed by the camera can be expected to be continuous. Several methods have been proposed to reflect this knowledge in measurement algorithms.

特許文献1では、特徴の抽出が容易なエッジ等を有する領域から、テクスチャが複雑で特徴の抽出が困難な領域へと奥行き情報の伝播を試みている。注目画素とその隣接画素の視差はほぼ等しいと仮定し、注目画素の視差と隣接画素の視差との差が一定数以下になるよう探索範囲を限定し、その範囲内で最も類似する対応点を採用する。   In Patent Document 1, an attempt is made to propagate depth information from a region having an edge or the like where feature extraction is easy to a region where texture is complicated and feature extraction is difficult. Assuming that the disparity between the pixel of interest and its neighboring pixels is approximately equal, the search range is limited so that the difference between the parallax of the pixel of interest and the parallax of the adjacent pixels is less than a certain number, and the most similar corresponding points within that range are determined. adopt.

また、非特許文献1では、ウィンドウコストに修正を加えることが提案されている。注目画素を挟んで左と右の二方向からウィンドウコストを累積的に加算し、かつ両者を合計する。こうして得た修正コストは、連続性の仮定に反するため対応させるべきでない点との非類似性が強調される。それにより、画像の水平方向について滑らかに連続する奥行きを支持する修正コストが得られる。   In Non-Patent Document 1, it is proposed to modify the window cost. The window costs are cumulatively added from the left and right directions with the pixel of interest in between, and the two are totaled. The correction cost obtained in this way is dissimilar to the point that it should not be matched because it violates the assumption of continuity. Thereby, a correction cost for supporting a smoothly continuous depth in the horizontal direction of the image can be obtained.

また、非特許文献2では、対応点を判定する方法として動的計画法が、また非特許文献1と非特許文献3では、走査線最適化法が提案されている。   Non-Patent Document 2 proposes a dynamic programming method as a method for determining corresponding points, and Non-Patent Document 1 and Non-Patent Document 3 propose a scanning line optimization method.

特許第2843034号「画像処理方法」Japanese Patent No. 2843034 "Image Processing Method"

Kim, J., Lee, K., Choi, B., and Lee, S. A dense stereo matching using two-pass dynamic programming with generalized ground control points. Proc. on Computer Vision and Pattern Recognishon, Vol.2, p.1075−1082, 2005.Kim, J., Lee, K., Choi, B., and Lee, S. A dense stereo matching using two-pass dynamic programming with generalized ground control points.Proc.on Computer Vision and Pattern Recognishon, Vol.2, p .1075-1082, 2005. A. F. Bobick and S. S. Intille. Large occlusion stereo. International Journal of Computer Vision, Vol.33, No.3, p.1−20, 1999.A. F. Bobick and S. S. Intille.Large occlusion stereo.International Journal of Computer Vision, Vol.33, No.3, p.1-20, 1999. D. Scharstein and R. Szeliski, A taxonomy and evaluation of dense two-frame stereo correspondence algorithms, International Jounal of Computer Vision, Vol.47, p. 7−42, 2002.D. Scharstein and R. Szeliski, A taxonomy and evaluation of dense two-frame stereo correspondence algorithms, International Jounal of Computer Vision, Vol. 47, p. 7-42, 2002.

しかし、特許文献1の構成では、テクスチャが弱く抽出すべき特徴そのものに乏しい領域では、対応させるべき点について類似性が極大とならず、適切な奥行き情報を伝播することができない、という問題がある。   However, in the configuration of Patent Document 1, there is a problem that, in a region where the texture is weak and the feature itself to be extracted is poor, the similarity is not maximized with respect to the point to be matched, and appropriate depth information cannot be propagated. .

また、非特許文献1に開示された方法でも、奥行きに段差があるとき適切な結果が得られない。奥行きの段差に対して、テクスチャの弱い領域へ誤った奥行き情報を伝播する、あるいは段差の形状を平滑化してしまう、という問題がある。物体の表面については奥行きを滑らかに連続させて、同時に段差については奥行きの不連続を保存しなければならない場合に、誤りが生じてしまう。   Further, even with the method disclosed in Non-Patent Document 1, an appropriate result cannot be obtained when there is a step in the depth. There is a problem in that erroneous depth information is propagated to an area having a weak texture or the shape of the step is smoothed with respect to the step of the depth. An error occurs when the depth of the surface of the object must be smoothly continuous and at the same time the depth discontinuity must be preserved for the step.

本発明は、上述した従来技術の課題に鑑みてなされたもので、テクスチャの弱い領域および奥行きの段差を有する画像であっても、画像の対応付けに際しミスマッチングを軽減して高精度の視差検出を行うことができるステレオ画像処理装置、方法を提供することを目的とする。   The present invention has been made in view of the above-described problems of the prior art, and even for an image having a weak texture region and a depth step, mismatching is reduced when matching images and high-precision parallax detection is performed. It is an object of the present invention to provide a stereo image processing apparatus and method capable of performing the above.

上記目的を達成するために、本発明では、画像入力手段と、ウィンドウコスト計算処理手段と、累積加算コスト計算処理手段と、修正コスト計算処理手段と、対応点判定手段と、視差データ記憶手段と、を有するステレオ画像処理装置を提案する。画像入力手段は、第一の画像取得手段からの第一の画像と第二の画像取得手段からの第二の画像が入力される。ウィンドウコスト計算処理手段は、第一の画像の第一の画素データを相互に異なる位置に含む複数の第一のウィンドウの各々について、当該第一ウィンドウと、指定された視差データに対応した第二の画像の第二のウィンドウとの間の非類似性に応じた評価値であるウィンドウコストを生成する。累積加算コスト計算処理手段は、第一のウィンドウのウィンドウコストに、第一の画素データに隣接する三以上の画素データのウィンドウコストを累積加算する。修正コスト計算処理手段は、累積加算コスト計算処理手段により計算した累積加算コストを集計した修正コストを計算する。対応点判定手段は、修正コストに基づいて第一の画像の画素データそれぞれの対応点を第二の画像において求め、視差データを出力する。視差データ記憶手段は、視差データを記憶する。     In order to achieve the above object, in the present invention, an image input means, a window cost calculation processing means, a cumulative addition cost calculation processing means, a correction cost calculation processing means, a corresponding point determination means, a parallax data storage means, , A stereo image processing apparatus is proposed. The image input means receives the first image from the first image acquisition means and the second image from the second image acquisition means. The window cost calculation processing means, for each of a plurality of first windows including the first pixel data of the first image at different positions, the second window corresponding to the first window and the designated parallax data A window cost that is an evaluation value corresponding to the dissimilarity between the image and the second window is generated. The cumulative addition cost calculation processing means cumulatively adds the window costs of three or more pixel data adjacent to the first pixel data to the window cost of the first window. The correction cost calculation processing means calculates a correction cost obtained by summing up the cumulative addition costs calculated by the cumulative addition cost calculation processing means. Corresponding point determination means obtains corresponding points of the pixel data of the first image in the second image based on the correction cost, and outputs parallax data. The parallax data storage means stores parallax data.

さらに上記構成において、修正コスト計算処理手段は、累積加算した方向各々のウィンドウコストを合計し、累積加算した隣接する画素の数から一を減じた数の前記第一の画素のウィンドウコストを、合計したウィンドウコストから減算することで修正コストを計算するステレオ画像処理装置を提案する。   Further, in the above configuration, the correction cost calculation processing means sums up the window costs of each direction in which the cumulative addition is performed, and sums up the window costs of the first pixels obtained by subtracting one from the number of adjacent pixels in the cumulative addition. We propose a stereo image processing device that calculates the correction cost by subtracting from the calculated window cost.

また、上記構成において、修正コスト計算処理手段は、隣接する方向それぞれの信頼性を評価し、評価値に基づいてそれぞれの方向に対応する隣接する画素のウィンドウコストを累積加算することで修正コストを計算するステレオ画像処理装置を提案する。   Further, in the above configuration, the correction cost calculation processing means evaluates the reliability of each adjacent direction, and accumulates the correction cost by accumulating the window costs of the adjacent pixels corresponding to each direction based on the evaluation value. A stereo image processing device for calculation is proposed.

また、対応点判定手段は、ウィンドウコストが最小値となる第二の画像データにおける画素データを対応点として判定するステレオ画像処理装置を提案する。   The corresponding point determination means proposes a stereo image processing apparatus that determines the pixel data in the second image data having the minimum window cost as the corresponding point.

さらに、対応点判定手段は、動的計画法により対応点を判定するステレオ画像処理装置を提案する。   Furthermore, the corresponding point determination means proposes a stereo image processing apparatus that determines corresponding points by dynamic programming.

本発明によれば、複数の面により奥行きの段差が形成される対象の計測において、計測する点に隣接する3以上の方向、例えば、上下左右4方向、あるいは斜めを含む8方向、あるいは任意の複数の方向から奥行きの連続性を反映することで、特定の方向においてテクスチャが弱い場合や、同じ方向にテクスチャが類似する場合であっても、他の方向から連続する奥行きが支持され、ステレオマッチングの精度を向上させることができる。   According to the present invention, in measurement of an object in which a step of depth is formed by a plurality of surfaces, three or more directions adjacent to the point to be measured, for example, four directions including up and down, left and right, or eight directions including oblique directions, or arbitrary By reflecting the continuity of depth from multiple directions, even if the texture is weak in a specific direction or the texture is similar in the same direction, continuous depth from other directions is supported and stereo matching Accuracy can be improved.

また、方向に優先順位を与えることによって、奥行きの段差を保存する。画素ごとに、各方向の信頼性を推定し、信頼性の低い方向の評価を低く、信頼性の高い方向の評価を高くすることによって、修正コストが平滑化されることを抑止することができる。   It also preserves depth steps by giving priority to directions. For each pixel, it is possible to prevent the correction cost from being smoothed by estimating the reliability in each direction, reducing the evaluation in the direction with low reliability, and increasing the evaluation in the direction with high reliability. .

本発明の画像処理装置の構成を示す図である。It is a figure which shows the structure of the image processing apparatus of this invention. ステレオ計測の原理を示す図である。It is a figure which shows the principle of a stereo measurement. 参照画像における対応点の探索方法を示す図である。It is a figure which shows the search method of the corresponding point in a reference image. 本発明におけるステレオ画像処理装置のブロック図である。It is a block diagram of the stereo image processing apparatus in this invention. 本発明における画像処理方法を示すフローチャートである。It is a flowchart which shows the image processing method in this invention. 累積加算における加算結果の再利用方法を説明する図である。It is a figure explaining the reuse method of the addition result in cumulative addition. 本発明における修正コストの算出方法を説明する図である。It is a figure explaining the calculation method of the correction cost in this invention. 累積加算における修正コストの算出方法の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the calculation method of the correction cost in cumulative addition. 最小ウィンドウコストの算出方法を示すフローチャートである。It is a flowchart which shows the calculation method of the minimum window cost. 方向の順位付け方法を示すフローチャートである。It is a flowchart which shows the ordering method of a direction. 方向間の累積加算方法を示すフローチャートである。It is a flowchart which shows the cumulative addition method between directions. 最下位の方向による初期値設定の方法を示すフローチャートである。It is a flowchart which shows the method of the initial value setting by the lowest direction. 残りの方向における累積加算方法を示すフローチャートである。It is a flowchart which shows the cumulative addition method in the remaining directions. 加算と最小値の判定方法を示すフローチャートである。It is a flowchart which shows the determination method of addition and minimum value. 入力するステレオ画像の例である。It is an example of the stereo image to input. 本発明を適用した場合の三次元計測結果である。It is a three-dimensional measurement result at the time of applying this invention.

図1は、本発明のステレオ画像処理装置の構成を示す図である。本発明のステレオ画像処理装置は、同一の対象物を撮影する二台のカメラと、撮影された二枚の画像から対応点を探索して奥行き情報を出力するコンピュータを備える。   FIG. 1 is a diagram showing a configuration of a stereo image processing apparatus of the present invention. The stereo image processing apparatus of the present invention includes two cameras that capture the same object, and a computer that searches for corresponding points from the two captured images and outputs depth information.

基準カメラによって撮影された画像はケーブル1によってコンピュータに転送され、基準画像として記憶される。参照カメラで撮影した画像はケーブル2によってコンピュータに転送され、参照画像として記憶される。これ以降、基準カメラと参照カメラの組をステレオカメラと呼び、基準画像と参照画像の組をステレオ画像と呼ぶ。   An image taken by the reference camera is transferred to the computer by the cable 1 and stored as a reference image. An image photographed by the reference camera is transferred to the computer by the cable 2 and stored as a reference image. Hereinafter, a set of the standard camera and the reference camera is called a stereo camera, and a set of the standard image and the reference image is called a stereo image.

基準カメラと参照カメラは、ピントや絞り,感度などの特性が等しくなるようにあらかじめ調整されており、撮影する位置のみが異なる。基準カメラと参照カメラは平行ステレオカメラとなるように配置される。平行ステレオカメラとは、二台のカメラの光軸が互いに平行であり、かつ撮像面が同一平面上にあって水平方向に整列されたものを指す。カメラの配置は左右が逆であっても、水平方向ではなく垂直方向に整列して配置してもよい。以降では説明を簡単にするため、左側を基準カメラ、右側を参照カメラとして扱う。   The reference camera and the reference camera are adjusted in advance so that characteristics such as focus, aperture, and sensitivity are equal, and only the shooting position is different. The reference camera and the reference camera are arranged to be a parallel stereo camera. A parallel stereo camera refers to a camera in which the optical axes of two cameras are parallel to each other and the imaging surfaces are on the same plane and are aligned in the horizontal direction. The cameras may be arranged in the vertical direction instead of the horizontal direction even if the left and right are reversed. Hereinafter, in order to simplify the description, the left side is treated as a reference camera and the right side is treated as a reference camera.

コンピュータはステレオマッチング装置と記憶装置とディスプレイを備える。ステレオマッチング装置はステレオ画像から対応点を探索する処理を行う。記憶装置は、カメラから取得したステレオ画像、およびステレオマッチング装置により作成する奥行き情報を記憶する。ディスプレイは奥行き情報に基づいて対象物を立体表示する。   The computer includes a stereo matching device, a storage device, and a display. The stereo matching device performs a process of searching for a corresponding point from the stereo image. The storage device stores a stereo image acquired from the camera and depth information created by the stereo matching device. The display stereoscopically displays the object based on the depth information.

図2は、ステレオ計測の原理を示す図である。三次元空間中の点P はステレオ画像に投影され、点P0および点P1をもたらす。基準カメラと参照カメラの位置が異なるため、それぞれの画像に投影された点の二次元座標は一致することなく、カメラから点Pまでの距離に応じて二次元座標のずれを生じる。このずれの大きさを視差と呼ぶ。計測前の点Pの三次元座標は未知であるため、その視差もまた未知である。ステレオカメラによる計測は、画像処理を用いてステレオ画像から視差を獲得することにより達せられる。基準画像上の点P0に対応する点P1を参照画像から精度良く求めるほど、より正確に点Pの三次元座標を計測することが可能となる。本発明において、視差と三次元座標を区別する必要がないとき、単に奥行き情報と呼ぶ。 FIG. 2 is a diagram illustrating the principle of stereo measurement. Point P in 3D space is projected onto a stereo image, resulting in points P 0 and P 1 . Since the positions of the reference camera and the reference camera are different, the two-dimensional coordinates of the points projected on the respective images do not coincide with each other, and a two-dimensional coordinate shift occurs according to the distance from the camera to the point P. The magnitude of this deviation is called parallax. Since the three-dimensional coordinates of the point P before measurement are unknown, the parallax is also unknown. Measurement by a stereo camera is achieved by acquiring parallax from a stereo image using image processing. The more accurately the point P 1 corresponding to the point P 0 on the reference image is obtained from the reference image, the more accurately the three-dimensional coordinates of the point P can be measured. In the present invention, when there is no need to distinguish between parallax and three-dimensional coordinates, it is simply called depth information.

コンピュータから,ステレオカメラに二枚の画像の撮影を指示する命令がされる。ステレオカメラにより撮影された画像はデジタル化され,コンピュータへと転送される。ステレオ画像が入力されると、コンピュータは基準画像上の点P0に対応する点P1を参照画像から探索する。点Pの視差が確定すると、三角測量の原理によりカメラ中心O0とO1および画像中の点P0とP1から三次元空間中の点Pの三次元座標が直ちに求まる。以上の処理を基準画像上の各画素について繰り返すことにより、ステレオカメラによって撮影された対象物に関する奥行き情報を獲得する。 The computer instructs the stereo camera to take two images. Images taken by the stereo camera are digitized and transferred to a computer. When a stereo image is input, the computer searches the reference image for a point P 1 corresponding to the point P 0 on the base image. When the parallax of the point P is determined, the three-dimensional coordinates of the point P in the three-dimensional space are immediately obtained from the camera centers O 0 and O 1 and the points P 0 and P 1 in the image by the principle of triangulation. By repeating the above processing for each pixel on the reference image, depth information regarding the object photographed by the stereo camera is acquired.

コンピュータは、得られた奥行き情報に基づいてディスプレイに対象物を立体的に表示する。あるいは対象物の形状を分析する処理を行って分析結果をディスプレイに表示する。   The computer displays the object three-dimensionally on the display based on the obtained depth information. Or the process which analyzes the shape of a target object is performed and an analysis result is displayed on a display.

図3は、対応点の探索方法を示す図である。ステレオ相関法は、基準画像上の各点ごとに、対応する点を参照画像より探索する。平行ステレオカメラよって撮影すると、一方の画像上のある一点に対する他方の画像上での対応点は、上下位置が同一の走査線上に存在することが知られている。走査線とは画像上に水平に並んだ画素の列である。すなわち基準画像上にある一点に対して対応点を求めるためには、参照画像上のただ一列の走査線を探索すればよい。平行ステレオカメラではない二台のカメラによって撮影が行われた場合でも、基準カメラと参照カメラの相対的な位置関係が既知であれば、平行化と呼ばれる画像変換によって同様の対応点探索が可能となる。 FIG. 3 is a diagram illustrating a corresponding point search method. In the stereo correlation method, for each point on the base image, a corresponding point is searched from the reference image. When photographing with a parallel stereo camera, it is known that a corresponding point on one image with respect to a certain point on one image has a vertical position on the same scanning line. A scanning line is a column of pixels arranged horizontally on an image. That is, in order to obtain a corresponding point for one point on the standard image, it is only necessary to search for a single line of scanning lines on the reference image. Even if the captured by two cameras not been carried out in parallel stereo camera, if the relative positional relationship of the base camera and the reference camera is known, the same corresponding point search by image transformation called collimated It becomes possible.

対応点の探索は、基準画像上に設けた小領域と、参照画像上に設けた小領域とを比較する。この小領域をウィンドウと呼ぶ。基準画像上の注目した画素に対し、その近傍にウィンドウを設ける。参照画像の走査線上に並んでいる対応点候補それぞれの近傍にウィンドウを設ける。ウィンドウ内に写る像より、注目画素と各対応点候補との非類似性を数値化する。この非類似性の評価値をウィンドウコストと呼ぶ。ウィンドウコストには、輝度の差分の絶対値の総和などを用いる。
図3のように、縦軸にウィンドウコストを、横軸に対応点候補の視差をとってグラフ化すると、類似性が最も高い候補においてピークを示す谷を描く曲線となる。ウィンドウコストが最小となる候補を対応点とする。
In the search for corresponding points, a small area provided on the reference image is compared with a small area provided on the reference image. This small area is called a window. A window is provided in the vicinity of the pixel of interest on the reference image. A window is provided in the vicinity of each corresponding point candidate lined up on the scanning line of the reference image. The dissimilarity between the pixel of interest and each corresponding point candidate is quantified from the image shown in the window. This dissimilarity evaluation value is called a window cost. For the window cost, the sum of absolute values of luminance differences is used.
As shown in FIG. 3, when the window cost is plotted on the vertical axis and the parallax of the corresponding point candidates is plotted on the horizontal axis, a curve is drawn that draws a valley that shows a peak in the candidate with the highest similarity. The candidate with the smallest window cost is taken as the corresponding point.

図4は、本発明におけるステレオ画像処理装置のブロック図である。カメラなどの画像取得手段401a、bと、画像取得手段からの画像を入力する画像入力部402、取得した画像を記憶するステレオ画像記憶手段403、ステレオマッチング装置410とステレオマッチング装置で算出された視差データを記憶する視差記憶手段408と、視差データに基づいて対象物体を立体表示するディスプレイなどの立体表示手段409を有している。   FIG. 4 is a block diagram of a stereo image processing apparatus according to the present invention. Image acquisition means 401a and b such as a camera, an image input unit 402 for inputting an image from the image acquisition means, a stereo image storage means 403 for storing the acquired image, a parallax calculated by the stereo matching device 410 and the stereo matching device It includes a parallax storage unit 408 that stores data, and a stereoscopic display unit 409 such as a display that stereoscopically displays the target object based on the parallax data.

ステレオマッチング装置410は、2台以上のカメラで構成されるステレオカメラからの画像であるステレオ画像の対応点を検出し視差データを得るための装置であって、通常は、コンピュータの制御手段が処理を行う。制御手段は、例えば、CPU(Central Processing Unit:中央演算処理装置)やVDP(Video Display Processor)などのプロセッサや、ASIC、ICメモリなどから構成される。ステレオマッチング装置410は、ウィンドウコスト計算処理部404、累積加算コスト計算処理部405、修正コスト計算処理部406、対応点判定部407を有している。   The stereo matching device 410 is a device for detecting corresponding points of a stereo image, which is an image from a stereo camera composed of two or more cameras, and obtaining parallax data, which is usually processed by a computer control means. I do. The control means includes, for example, a processor such as a CPU (Central Processing Unit) or a VDP (Video Display Processor), an ASIC, an IC memory, and the like. The stereo matching device 410 includes a window cost calculation processing unit 404, a cumulative addition cost calculation processing unit 405, a correction cost calculation processing unit 406, and a corresponding point determination unit 407.

ウィンドウコスト計算処理部404は、参照画像における対応点を探索するために、基準画像に含まれる各画素についてウィンドウコストの計算を行う。ステレオ画像入力部402よりステレオ画像が入力されると、ウィンドウコスト計算処理部404はウィンドウコストの計算を開始する。ウィンドウコストの計算は、基準画像に含まれる各画素について繰り返す。   The window cost calculation processing unit 404 calculates a window cost for each pixel included in the reference image in order to search for corresponding points in the reference image. When a stereo image is input from the stereo image input unit 402, the window cost calculation processing unit 404 starts calculating the window cost. The calculation of the window cost is repeated for each pixel included in the reference image.

累積加算コスト計算処理部405は、基準画像の各画素について、ウィンドウコストの累積加算を行う。累積加算は、基準画素を中心として任意の方向に隣接する3以上の画素であればよく、例えばある画素を中心とする8方向において隣接する画素からコストを累積加算することによって行う。   The cumulative addition cost calculation processing unit 405 performs cumulative addition of window costs for each pixel of the reference image. The cumulative addition may be three or more pixels adjacent in an arbitrary direction with the reference pixel as the center. For example, the cumulative addition is performed by cumulatively adding the costs from the pixels adjacent in the eight directions centered on a certain pixel.

修正コスト計算処理部406は、累積加算コスト計算処理部405において計算した累積加算コストについて、奥行きの連続性が反映されるように、合計か、各方向の信頼性を算出することで修正コストの算出を行う。修正コストの計算方法の詳細については、後述する。   The correction cost calculation processing unit 406 calculates the total cost or the reliability of each direction for the cumulative addition cost calculated by the cumulative addition cost calculation processing unit 405 so that the continuity of the depth is reflected. Perform the calculation. Details of the correction cost calculation method will be described later.

対応点判定部407は、修正コスト計算処理部406で計算された修正コストに基づいて、カメラから対象物までの奥行きを推定して、対応点を判定し、対応点の視差を計算する。   The corresponding point determination unit 407 estimates the depth from the camera to the object based on the correction cost calculated by the correction cost calculation processing unit 406, determines the corresponding point, and calculates the parallax of the corresponding point.

視差記憶手段408は、対応点判定部407において計算された視差データを記憶する。立体表示手段409は、計算された視差データをもとに、対象物の3次元表示を可能とする表示手段である。   The parallax storage unit 408 stores the parallax data calculated by the corresponding point determination unit 407. The stereoscopic display unit 409 is a display unit that enables three-dimensional display of an object based on the calculated parallax data.

図5は、本発明における画像処理方法を示すフローチャートである。まず、画像取得手段(401a、b)は、ステレオ画像を撮影し、撮影されたステレオ画像は画像入力部(402)からステレオ画像記憶手段(403)へ記憶される(S501)。   FIG. 5 is a flowchart showing an image processing method according to the present invention. First, the image acquisition unit (401a, b) captures a stereo image, and the captured stereo image is stored in the stereo image storage unit (403) from the image input unit (402) (S501).

記憶されたステレオ画像に基づいて、対応点探索のためにウィンドウコストを計算する(S502)。オペレータはあらかじめ、対応点の探索範囲の上限dmaxと下限dmin、奥行きの不連続にペナルティを課すためのしきい値T,奥行きの連続性が反映される視差の範囲m、奥行きの連続性を反映する方向とその数n、対応点の探索に用いるウィンドウの大きさwをコンピュータに入力しておく。ウィンドウの形状は正方形であり、wは一辺の長さを表す。なお、ウィンドウの形状は必ずしも正方形に制限されず、長方形などであってもよい。ウィンドウコストは、次のように計算される。まず画像の水平座標値をx、垂直座標値をyによって表す。基準画像上のある二次元座標(x, y)の画素に注目し、図3に示すように(x, y)を中心としてウィンドウを設ける。対応点候補となる視差dの画素について、参照画像上の座標(x-d, y)を中心にウィンドウを設ける。 Based on the stored stereo image, a window cost is calculated for the corresponding point search (S502). The operator sets in advance the upper limit d max and lower limit d min of the corresponding point search range, the threshold T for imposing a penalty on the depth discontinuity, the parallax range m reflecting the depth continuity, and the depth continuity Are input to the computer in the direction reflecting the number and the number n, and the window size w used for searching for the corresponding points. The window has a square shape and w represents the length of one side. Note that the shape of the window is not necessarily limited to a square, and may be a rectangle or the like. The window cost is calculated as follows. First, the horizontal coordinate value of the image is represented by x, and the vertical coordinate value is represented by y. Paying attention to a pixel at a certain two-dimensional coordinate (x, y) on the reference image, a window is provided around (x, y) as shown in FIG. A window is provided around the coordinate (xd, y) on the reference image for the pixel of parallax d that is a corresponding point candidate.

基準画像と参照画像のウィンドウの組より、ウィンドウコストC(x, y, d)を以下の計算によって求める。Ilは基準画像の画素の輝度,Irは参照画像の画素の輝度を表す。このウィンドウコストをSAD(Sum of Absolute Differences)と呼ぶ。ウィンドウコストはウィンドウ間の非類似性を表す指標であればよく、SSD(Sum of Squared Differences)すなわち輝度の差の自乗和などを用いてもよい。 The window cost C (x, y, d ) is obtained by the following calculation from the set of the standard image and reference image windows. I l The luminance of the pixels of the reference image, the I r represents the luminance of the pixels of the reference image. This window cost is called SAD (Sum of Absolute Differences). The window cost may be an index representing dissimilarity between windows, and SSD (Sum of Squared Differences), that is, the sum of squares of luminance differences may be used.

次にコンピュータは基準画像の各画素について、ウィンドウコストの累積加算を繰り返す(S503)。基準画像の画素に注目したとき、視差dのウィンドウコストの加算について説明する。注目画素(x, y)の視差dに関する累積加算コストGk(x, y, d)を求めるため、次の計算を行う。注目画素から見て方向kに隣接する画素の座標を(x+a, y+b)とする。d-mからd+mまでの範囲に含まれる視差をd’で表す。隣接画素の累積加算コストGk(x+a, y+b, d’)と、奥行きの不連続に対するペナルティ関数t(d, d’)の値とを合計する。視差d’の範囲d-mからd+mの中から最小となる合計値を求め、前記処理によって求めたウィンドウコストC(x, y, d)に加算して、累積加算コストGk(x, y, d)として記憶する。 Next, the computer repeats cumulative addition of window costs for each pixel of the reference image (S503). When attention is paid to the pixels of the reference image, the addition of the window cost of the parallax d will be described. The pixel of interest (x, y) accumulating costs about the parallax d of G k (x, y, d ) for determining the, the following calculation is performed. Let (x + a, y + b) be the coordinates of a pixel adjacent in the direction k as viewed from the target pixel. The parallax included in the range from dm to d + m is represented by d ′. The cumulative addition cost G k (x + a, y + b, d ′) of adjacent pixels and the value of the penalty function t (d, d ′) for the depth discontinuity are summed. A minimum total value is obtained from the range dm to d + m from the range dm of the parallax d ′, added to the window cost C (x, y, d) obtained by the above processing, and the cumulative addition cost G k (x, y , d).

記憶した累積加算コストGk(x, y, d)は、将来において同じ方向k上の画素の累積加算時に参照することが可能となる。したがって過去に累積加算コストを計算した画素が存在す
る方向は、記憶済みの累積加算コストを参照することによって、累積加算の計算量を削減できる。
The stored cumulative addition cost G k (x, y, d) can be referred to at the time of cumulative addition of pixels in the same direction k in the future. Therefore, in the direction in which the pixel for which the cumulative addition cost has been calculated in the past exists, the calculation amount of the cumulative addition can be reduced by referring to the stored cumulative addition cost.

例として、注目画素を中心とする8方向からウィンドウコストを累積加算する場合、図6のように順方向ラスタスキャンにおいて左方向から斜め右下方向にかけての計算を行う。同様に逆方向ラスタスキャンにおいて右方向から斜め左上方向にかけての計算を行うと、画像を二回走査するだけで累積加算の処理が完了する。ここで順方向ラスタスキャンとは画像の左上から右下へ向かう経路を意味し、走査線上の画素を左から右へ走査し、走査線を上から下へ辿る。一方、逆方向ラスタスキャンとは画像の右下から左上へ向かう経路を意味し、走査線上の画素を右から左へ走査し、走査線を下から上へ辿る。 As an example, when window costs are cumulatively added from eight directions centered on the pixel of interest, calculation from the left direction to the diagonally lower right direction is performed in the forward raster scan as shown in FIG. Similarly, when calculation is performed from the right direction to the diagonally upper left direction in the reverse raster scan, the cumulative addition process is completed only by scanning the image twice. Here, the forward raster scan means a path from the upper left to the lower right of the image, scanning pixels on the scanning line from left to right, and tracing the scanning line from top to bottom. On the other hand, the reverse raster scan means a path from the lower right to the upper left of the image, scanning pixels on the scanning line from right to left, and tracing the scanning line from bottom to top.

なおt(d, d’)は次の関数とする。奥行きが連続するという仮定が成り立つとき値が0となり、仮定から外れるとき値がTとなる。Tはペナルティの大きさを表すしきい値である。   Note that t (d, d ′) is the following function. The value is 0 when the assumption that the depth is continuous holds, and the value is T when the assumption is not satisfied. T is a threshold value representing the magnitude of the penalty.

また、上記の計算方法における視差d’の範囲d-mからd+mは、m>0でなければならない。この範囲内からGk(x+a, y+b, d’)の最小値を求めた場合、その値が描く曲線はピークが平坦なものになる。すなわちm>0とすることによって、注目画素から画像上の距離が離れている画素ほど、そのウィンドウコストが修正コストに与える影響は小さくなる。これにより、注目画素から遠く離れた画素が、注目画素に対して奥行きを連続させるよう過剰に拘束をかけることを防止する。 In addition, the range dm to d + m of the parallax d ′ in the above calculation method must satisfy m> 0. When the minimum value of G k (x + a, y + b, d ′) is obtained from this range, the curve drawn by that value has a flat peak. That is, by setting m> 0, the influence of the window cost on the correction cost becomes smaller as the pixel on the image is farther from the target pixel. This prevents a pixel far from the target pixel from being excessively constrained so that the depth is continuous with respect to the target pixel.

以上の処理を注目画素の全ての対応点候補について行い、注目画素の方向kに累積加算された累積加算コストを計算する。この処理を1からnまで繰り返し、各方向のウィンドウコストを累積加算して記録する。 The above processing is performed for all corresponding point candidates of the target pixel, and the cumulative addition cost cumulatively added in the direction k of the target pixel is calculated. This process is repeated from 1 to n, and the window cost in each direction is cumulatively added and recorded.

コンピュータは前記処理によって累積加算した累積加算コストより、n個の方向より奥行きの連続性が反映されるよう修正された修正コストを計算する(S504)。n個の処理結果を合計する(S505)か、あるいはn個の処理結果を累積加算して(S506)、修正コストを求める。後者を用いることにより、奥行きの段差を保存する効果が得られる。合計による修正コストの計算方法及び累積加算による修正コストの計算方法については、後述する。 The computer calculates a correction cost corrected to reflect the continuity of depth from the n directions from the cumulative addition cost accumulated by the above processing (S504). The n processing results are summed (S505), or the n processing results are cumulatively added (S506) to obtain the correction cost. By using the latter, the effect of preserving the depth difference can be obtained. A method for calculating the correction cost by summation and a method for calculating the correction cost by cumulative addition will be described later.

次に、ステレオマッチング装置410の対応点判定部407は、修正コストの情報を基に、画像取得手段(401a、b)から対象物までの奥行きを推定して、視差データを作成する(S507)。対応点の探索範囲を[dmin, dmax]で表すとき、画素(x, y)について Next, the corresponding point determination unit 407 of the stereo matching device 410 estimates the depth from the image acquisition means (401a, b) to the object based on the correction cost information, and creates parallax data (S507). . When the search range of corresponding points is represented by [d min , d max ], for pixel (x, y)

となる対応点の視差D(x, y)を計算する処理を行う(S509)。これを基準画像の各画素について繰り返す。対応点を判定する方法には、非特許文献2に記載されている動的計画法を用いてもよい(S508)。また、動的計画法の代わりに、非特許文献3に記載されている走査線最適化法を用いてもよい。 A process for calculating the parallax D (x, y) of the corresponding point is performed (S509). This is repeated for each pixel of the reference image. As a method for determining the corresponding points, dynamic programming described in Non-Patent Document 2 may be used (S508). Further, instead of the dynamic programming method, a scanning line optimization method described in Non-Patent Document 3 may be used.

動的計画法によって対応点を判定する場合は次のように行う。まず探索平面を作成する。これは基準画像と参照画像に共通する水平な走査線を二本の座標軸とする平面である。探索平面上の点は、基準画像および参照画像の走査線上にある二点の対応関係を表現する。ある二点をステレオカメラで撮影したとき、それらの点の位置関係は両方の画像で同じになること可能性が高い。つまり、一般的には一方の画像に左右の関係で写った二点は、他方の画像に左側の点と右側の点が入れ替わって写ることはない。したがって探索平面上の対応点は、座標値が基準・参照ともに小さい方から大きい方へ単調に増加する点の列となる。これによって作られる点列の候補の中から、漸化計算を用いて点列上の各点の修正コストの合計が最小となる点列を動的計画法により探索し、その点列に含まれる各点を対応点として採用する。 When the corresponding points are determined by dynamic programming, it is performed as follows. First, a search plane is created. This is a plane having two horizontal scanning lines common to the standard image and the reference image as two coordinate axes. A point on the search plane expresses a correspondence between two points on the scanning line of the base image and the reference image. When two points are shot with a stereo camera, the positional relationship between these points is likely to be the same in both images. That is, in general, two points that appear in one image in a left-right relationship do not appear in the other image because the left point and the right point are interchanged. Accordingly, the corresponding points on the search plane are a sequence of points whose coordinate values monotonously increase from the smallest to the largest in both the standard and the reference. A point sequence that minimizes the total correction cost of each point on the point sequence is searched by dynamic programming from the point sequence candidates created by this, and is included in the point sequence. Each point is adopted as a corresponding point.

走査線最適化法は、探索平面の座標軸を基準画像の水平な走査線および視差とし、基準画像の水平座標が単調増加する点列を候補とする。また連続する二点間の視差が異なる場合にはペナルティとなる値を加える。それ以外は動的計画法と同様の方法によって対応点を決定する。   In the scanning line optimization method, the coordinate axis of the search plane is set as the horizontal scanning line and parallax of the reference image, and a point sequence in which the horizontal coordinate of the reference image monotonously increases is set as a candidate. If the disparity between two consecutive points is different, a penalty value is added. Otherwise, the corresponding points are determined by the same method as the dynamic programming.

次に、ステレオマッチング装置410は、対応点の判定によって得られた結果を出力し、基準画像の各画素について視差データを記憶する(S510)。   Next, the stereo matching device 410 outputs the result obtained by determining the corresponding points, and stores the parallax data for each pixel of the reference image (S510).

修正コストの算出方法について、まず合計による修正コスト算出方法(S505)について図7を参照しながら、説明する。本発明では、奥行きの連続性を注目画素に反映するために、注目画素を挟む水平な二方向だけでなく、複数の任意の方向を考慮して修正コストを算出する。図7に示すように注目画素(x, y)を中心するn個の方向kに累積加算したコストを合計する。なお、8近傍の方向を考慮する場合、n=8であり、8方向となる。このように合計された値には注目画素のウィンドウコストがn倍されて含まれることになる。注目画素の奥行きに対する不要な重みづけを取り除くため、方向数nから1を減じた数に倍する注目画素のウィンドウコストC(x, y, d)を減算し、注目画素の修正コストS(x, y, d)とする。修正コストS(x, y, d)は次の式によって表される。   Regarding the correction cost calculation method, first, the total correction cost calculation method (S505) will be described with reference to FIG. In the present invention, in order to reflect the continuity of the depth on the target pixel, the correction cost is calculated in consideration of not only two horizontal directions sandwiching the target pixel but also a plurality of arbitrary directions. As shown in FIG. 7, the costs accumulated and added in n directions k around the pixel of interest (x, y) are totaled. In addition, when considering the directions in the vicinity of 8, n = 8, which is 8 directions. The total value includes the window cost of the target pixel multiplied by n. In order to remove unnecessary weighting on the depth of the pixel of interest, the window cost C (x, y, d) of the pixel of interest that is doubled by subtracting 1 from the number of directions n is subtracted, and the correction cost S (x , y, d). The correction cost S (x, y, d) is expressed by the following equation.

次に信頼性に基づいて方向ごとに優先順位を与え、奥行きの段差が保存されるよう修正コストを算出する方法(S506)について説明する。図8は累積加算による修正コストの算出方法を示す概要フローチャートである。各画素にn個の方向を順序付けるため、下記の計算によって各方向の信頼性を評価する。すなわち、注目画素の隣接画素を参照し、よりウィンドウコストの小さい画素が存在する方向をより信頼性が高いものとする。まず、注目画素の各方向の隣接画素について最小ウィンドウコストをそれぞれ探索する(S801)。次に、最小ウィンドウコストの集合を降順にソートすることで方向の順位付けを行い(S802)、方向間の累積加算を行う(S803)。   Next, a description will be given of a method (S506) in which priority is given for each direction based on reliability, and the correction cost is calculated so that the depth difference is preserved. FIG. 8 is a schematic flowchart showing a method for calculating the correction cost by cumulative addition. In order to order n directions for each pixel, the reliability of each direction is evaluated by the following calculation. That is, referring to the adjacent pixel of the target pixel, the direction in which a pixel with a smaller window cost exists is made more reliable. First, the minimum window cost is searched for adjacent pixels in each direction of the target pixel (S801). Next, directions are ranked by sorting the set of minimum window costs in descending order (S802), and cumulative addition between directions is performed (S803).

図9は、S801における最小ウィンドウコストの探索方法を具体的に示すフローチャートである。注目画素(x, y)に対して方向kで隣接する画素の、視差dに応じて変化するウィンドウコストC(x+a, y+b, d)から、最小値Mk(x+a, y+b)を求める。方向は注目画素に対して相対的なので、最小値の算出は画素ごとに方向の数だけ繰り返す必要はなく、画素ごとに1回ずつ求める。最初の画像座標から注目画素(x, y)として設定し(S901)、方向kで隣接する画素のウィンドウコストの上限値をM(x, y)として設定する(S902)。ウィンドウコストの最小値を求めるために最小視差から最大視差までdの値を1ずつ増やして計算する(S903)。視差dの値に応じて変化するC(x, y, d)がM(x, y)より小さいか判定し(S904)、M(x, y)>C(x, y, d)の場合はC(x, y, d)をM(x, y)として設定する(S905)。このように判定していくことで注目画素(x, y)の方向kにおけるウィンドウコストの最小値を求める(S906)。次の画像座標を(x, y)と設定し(S907)、同様に、また全ての画素についてスキャンを行ってウィンドウコストの最小値を算出していく(S908)。 FIG. 9 is a flowchart specifically showing the search method of the minimum window cost in S801. From the window cost C (x + a, y + b, d) of the pixel adjacent to the target pixel (x, y) in the direction k, which changes according to the parallax d, the minimum value M k (x + a, Find y + b). Since the direction is relative to the target pixel, the minimum value need not be repeated for each pixel by the number of directions, and is calculated once for each pixel. The target pixel (x, y) is set from the first image coordinates (S901), and the upper limit value of the window cost of the pixel adjacent in the direction k is set as M (x, y) (S902). In order to obtain the minimum value of the window cost, the value of d is incremented by 1 from the minimum parallax to the maximum parallax (S903). It is determined whether C (x, y, d) that changes according to the value of the parallax d is smaller than M (x, y) (S904), and M (x, y)> C (x, y, d) Sets C (x, y, d) as M (x, y) (S905). By determining in this way, the minimum value of the window cost in the direction k of the target pixel (x, y) is obtained (S906). The next image coordinate is set to (x, y) (S907), and similarly, all pixels are scanned to calculate the minimum value of the window cost (S908).

図10は、S802における方向の順位付け方法を具体的に示すフローチャートである。最初の画像座標から注目画素(x, y)として設定し(S1001)、方向の番号と最小ウィンドウコストをn個分、列に格納していく(S1002)。第k方向の隣接画素の相対座標を(a, b)と設定し(S1003)、列rのk番目の要素に第k方向の最小ウィンドウコストM(x+a, y+b)を格納し、列q(x, y)のk番目の要素に方向kの番号を格納し(S1004)、同様にn個分について繰り返す(S1005)。次に列rのウィンドウコストの降順に方向の列q(x, y)をソートする(S1006)。次の画像座標を(x, y)と設定し(S1007)、同様に、すべての画像座標についてスキャンを行って処理を繰り返す(S1008)。以上の処理によって、優先順位iを方向kに対応付ける関数q(x, y, i)を得る。なお、iは数値が大きいほど信頼性が高いものとする。このとき(x, y)の優先順位iについて次の関係が成り立つ。   FIG. 10 is a flowchart specifically showing the direction ranking method in S802. The pixel of interest (x, y) is set from the first image coordinates (S1001), and the number of directions and the minimum window cost are stored in a row for n (S1002). The relative coordinates of adjacent pixels in the kth direction are set to (a, b) (S1003), and the minimum window cost M (x + a, y + b) in the kth direction is stored in the kth element of the column r. The number of the direction k is stored in the kth element of the column q (x, y) (S1004), and the same is repeated for n (S1005). Next, the column q (x, y) in the direction is sorted in descending order of the window cost of the column r (S1006). The next image coordinate is set as (x, y) (S1007), and scanning is similarly performed for all the image coordinates (S1008). Through the above processing, a function q (x, y, i) that associates the priority order i with the direction k is obtained. It is assumed that i is more reliable as the value is larger. At this time, the following relationship holds for the priority order i of (x, y).

図11は、S803における方向間の累積加算方法を具体的に示すフローチャートである。最初の画像座標から注目画素(x, y)として設定し(S1101)、優先順位が最下位の方向の累積加算コストを修正コスト計算の初期値として設定する(S1102)。図12は、最下位の方向による初期値の設定方法のフローを示している。まず、q(x, y, 1)より得られる最下位の方向の番号を方向jに設定する(S1201)。次に、dを最小視差から最大視差まで1ずつ増やし(S1202)、j方向の累積加算コストGj(x, y, d)を修正コストS(x, y, d)の初期値とし(S1203)、すべての視差について繰り返す(S1204)。 FIG. 11 is a flowchart specifically showing the cumulative addition method between directions in S803. The pixel of interest (x, y) is set from the first image coordinates (S1101), and the cumulative addition cost in the direction with the lowest priority is set as the initial value of the correction cost calculation (S1102). FIG. 12 shows a flow of an initial value setting method in the lowest direction. First, the lowest direction number obtained from q (x, y, 1) is set in the direction j (S1201). Next, d is incremented by 1 from the minimum parallax to the maximum parallax (S1202), and the cumulative addition cost G j (x, y, d) in the j direction is set as the initial value of the correction cost S (x, y, d) (S1203). ), And repeats for all parallaxes (S1204).

次に残りの方向について累積加算を行っていく(S1103)。図13は、残りの方向による累積加算の算出方法を示すフローチャートである。優先順位の変数iを2から最上位まで順に1ずつ増やすことで順次、累積加算を行っていく(S1301)。すなわち、優先順位を下からi番目とした場合に、q(x, y, i)より得られる第i位の方向の番号を方向jに設定する(S1302)。dを最小視差から最大視差まで1ずつ増やして累積加算コストを加算していく(S1303)。累積加算コストの加算と累積加算コストの最小値の判定処理を行い(S1304)、全ての視差について繰り返す(S1305)。以上の処理によって求めた第i位までの方向の加算結果S’(d)、dを最小視差から最大視差まで1ずつ増やして(S1306)、修正コストS(x, y, d)に代入し(S1307)、すべての視差について繰り返す(S1308)。同様に、全ての順位の方向について繰り返す(S1309)。 Next, cumulative addition is performed for the remaining directions (S1103). FIG. 13 is a flowchart showing a calculation method of cumulative addition in the remaining directions. Cumulative addition is performed sequentially by increasing the priority variable i by 1 in order from 2 to the highest (S1301). That is, when the priority order is the i-th from the bottom, the i-th direction number obtained from q (x, y, i) is set to the direction j (S1302). The cumulative addition cost is added by increasing d by 1 from the minimum parallax to the maximum parallax (S1303). The process of adding the cumulative addition cost and determining the minimum value of the cumulative addition cost is performed (S1304), and repeated for all parallaxes (S1305). Substituting the i-th position to the direction of the sum of S '(d), is increased by 1 to d until maximum disparity from the minimum disparity (S1306), modified cost S (x, y, d) the obtained by the above process (S1307) and repeat for all parallaxes (S1308). Similarly, it repeats about the direction of all the ranks (S1309).

加算と最小値の判定処理(S1304)について、図14により説明する。修正コストの上限値をBと設定する(S1401)。すでに計算された下位の方向の計算結果のうち、視差dとの差が奥行きの連続性が反映される範囲mに含まれる視差d’について(S1402)、Bが修正コストS(x, y, d)にペナルティ関数t(d, d’)を加算した値よりも大きいか判定する。Bの値大きい場合はS(x, y, d)+t(d, d’)をBに代入し(S1404)、そうでない場合はBを変えない。同様に、範囲内の全ての視差d’について繰り返す(S1405)。方向jの累積加算コストに求めた最小値を積算し、S’(d)に代入する(S1406)。 The addition and minimum value determination processing (S1304) will be described with reference to FIG. The upper limit value of the correction cost is set to B (S1401). Of the calculation results in the lower direction already calculated, for the parallax d ′ whose difference from the parallax d is included in the range m in which the continuity of the depth is reflected (S1402), B is the correction cost S (x, y, It is determined whether it is larger than the value obtained by adding the penalty function t (d, d ') to d). If the value of B is large, S (x, y, d) + t (d, d ') is substituted for B (S1404). Otherwise, B is not changed. Similarly, it repeats about all the parallax d 'within a range (S1405). The minimum value obtained in the cumulative addition cost in the direction j is integrated and substituted into S ′ (d) (S1406).

図11に戻り、このようにしてすべての方向における累積加算を行った後、注目画素のウィンドウコストを最小視差から最大視差まで全ての視差の値において累積加算した修正コストから減算する処理を行う(S1104)。つまり、S(x, y, d)−C(x, y, d)を修正コストS(x, y, d)とする処理を繰り返す(S1105、S1106)。そして次の画像座標へと移り、すべての画素について累積加算により修正コストを得る。   Returning to FIG. 11, after performing cumulative addition in all directions in this way, a process of subtracting the window cost of the pixel of interest from the correction cost obtained by cumulatively adding all the parallax values from the minimum parallax to the maximum parallax ( S1104). That is, the process of setting S (x, y, d) -C (x, y, d) as the correction cost S (x, y, d) is repeated (S1105, S1106). Then, the process proceeds to the next image coordinate, and the correction cost is obtained by cumulative addition for all pixels.

このように、各方向について累積加算したウィンドウコストを、さらに方向間で累積加算することによって段差を保存する修正コストを得る。注目画素から離れた画素のウィンドウコストは注目画素の修正コストに与える影響が小さくなる。累積加算の方法を各方向の結果にも適用し、信頼性の低い方向から高い方向へ処理を進めることによって、確からしい方向の結果ほどより強く修正コストに反映させる。累積加算によって求める場合の、n個の方向に基づく修正コストS(x, y, d)は次の式によって表される。 In this way, a correction cost for preserving the level difference is obtained by further cumulatively adding the window cost accumulated in each direction between the directions. The window cost of a pixel far from the target pixel has less influence on the correction cost of the target pixel. By applying the cumulative addition method to the results in each direction and proceeding from the low reliability direction to the high direction, the probable direction results are more strongly reflected in the correction cost. The correction cost S (x, y, d) based on n directions when obtained by cumulative addition is represented by the following equation.

次に、本発明の適用例を説明する。図15は、入力するステレオ画像の例を示している。この画像には、背景にテクスチャの弱い領域である壁面や類似するテクスチャが水平方向に続く領域がある。本発明の画像処理装置により、8方向において修正コストを算出してステレオマッチング処理を行い、三次元計測を行った結果が図16である。このように、本発明を適用することで、複数の面によって奥行きに段差が形成されているような画像においても正確にステレオマッチング処理を行うことができる。   Next, application examples of the present invention will be described. FIG. 15 shows an example of a stereo image to be input. In this image, there are a wall surface which is a weak texture region and a region where a similar texture continues in the horizontal direction in the background. FIG. 16 shows the result of performing the three-dimensional measurement by calculating the correction cost in eight directions and performing the stereo matching process by the image processing apparatus of the present invention. As described above, by applying the present invention, it is possible to accurately perform stereo matching processing even in an image in which steps are formed in the depth by a plurality of surfaces.

本発明は、ステレオ画像をもとに視差データを算出する画像処理装置に適用可能である。     The present invention can be applied to an image processing apparatus that calculates parallax data based on a stereo image.

401a,b 画像取得手段
402 画像入力部
403 ステレオ画像記憶手段
404 ウィンドウコスト計算処理部
405 累積加算コスト計算処理部
406 修正コスト計算処理部
407 対応点判定部
408 視差記憶手段
409 立体表示手段
410 ステレオマッチング装置
401a, b Image acquisition unit 402 Image input unit 403 Stereo image storage unit 404 Window cost calculation processing unit 405 Cumulative addition cost calculation processing unit 406 Correction cost calculation processing unit 407 Corresponding point determination unit 408 Parallax storage unit 409 Stereo display unit 410 Stereo matching apparatus

Claims (4)

第一の画像取得手段からの第一の画像と第二の画像取得手段からの第二の画像が入力される画像入力手段と、
前記第一の画像に含まれる画素ごとに、前記第一の画像に設定される第一のウィンドウと、前記第一のウィンドウに対応して前記第二の画像に設定される第二のウィンドウとの間の非類似性に応じた評価値であるウィンドウコストを計算するウィンドウコスト計算処理手段と、
前記第一の画像に含まれる画素ごとに計算されたウィンドウコストを累積加算して累積加算コストを計算する累積加算コスト計算処理手段と、
前記累積加算コストを修正する修正コストを計算する修正コスト計算処理手段と、
前記修正コストに基づいて前記第一のウィンドウに含まれる画素に対応する点を前記第二の画像において求め、視差データを出力する対応点判定手段と、
前記視差データを記憶する視差データ記憶手段と、
を有してなり、
前記ウィンドウコスト計算処理手段は、前記第一のウィンドウに含まれる注目画素に対応して設定された複数の対応点候補ごとに前記第二のウィンドウを設定して前記ウィンドウコストを計算し、
前記累積加算コスト計算処理手段は、前記複数の対応点候補のそれぞれに応じた視差ごとに、前記第一の画像に含まれる画素のうち前記注目画素から同じ方向上の画素のウィンドウコストを累積加算して、前記注目画素からの方向ごとに前記累積加算コストを計算し、
前記修正コスト計算処理手段は、前記複数の対応点候補のそれぞれに応じた視差ごとに、前記注目画素からの方向ごとの信頼性を評価し、前記注目画素からの方向ごとに計算された前記累積加算コストを前記信頼性の低い方向の累積加算コストから順に加算して前記修正コストを計算し、
前記対応点判定手段は、前記注目画素に対応して設定された複数の対応点候補のうち、前記修正コストが最小となる対応点候補を対応点として、前記注目画素と前記対応点との視差データを出力し、
前記累積加算コスト計算処理手段が前記複数の対応点候補のそれぞれに応じた視差ごとに計算する前記累積加算コストは、前記視差から所定の範囲に隣接する画素ごとの累積加算コストのうち最小の累積加算コストが累積加算されて計算され、
前記修正コスト計算処理手段が前記複数の対応点候補のそれぞれに応じた視差ごとに計算する前記修正コストは、前記視差から所定の範囲に隣接する画素ごとの累積加算コストのうち最小の累積加算コストが累積加算されて計算される、
ことを特徴とするステレオ画像処理装置。
An image input means for inputting a first image from the first image acquisition means and a second image from the second image acquisition means;
For each pixel included in the first image, a first window set in the first image, and a second window set in the second image corresponding to the first window; Window cost calculation processing means for calculating a window cost, which is an evaluation value according to dissimilarity between,
Cumulative addition cost calculation processing means for calculating a cumulative addition cost by cumulatively adding a window cost calculated for each pixel included in the first image;
Correction cost calculation processing means for calculating a correction cost for correcting the cumulative addition cost;
A corresponding point determining means for obtaining a point corresponding to a pixel included in the first window based on the correction cost in the second image and outputting parallax data;
Parallax data storage means for storing the parallax data;
Having
The window cost calculation processing means calculates the window cost by setting the second window for each of a plurality of corresponding point candidates set corresponding to the target pixel included in the first window,
The cumulative addition cost calculation processing means cumulatively adds window costs of pixels in the same direction from the target pixel among the pixels included in the first image for each parallax corresponding to each of the plurality of corresponding point candidates. And calculating the cumulative addition cost for each direction from the target pixel,
The correction cost calculation processing means evaluates reliability for each direction from the target pixel for each parallax corresponding to each of the plurality of corresponding point candidates, and calculates the accumulation calculated for each direction from the target pixel. The correction cost is calculated by adding the addition cost sequentially from the cumulative addition cost in the direction of low reliability,
The corresponding point determination means uses the corresponding point candidate having the minimum correction cost as a corresponding point among the plurality of corresponding point candidates set corresponding to the target pixel, and the parallax between the target pixel and the corresponding point Output data,
The cumulative addition cost calculated by the cumulative addition cost calculation processing unit for each parallax corresponding to each of the plurality of corresponding point candidates is a minimum cumulative cost among the cumulative addition costs for each pixel adjacent to a predetermined range from the parallax. Addition cost is calculated by accumulating,
The correction cost calculated by the correction cost calculation processing unit for each parallax corresponding to each of the plurality of corresponding point candidates is the minimum cumulative addition cost among the cumulative addition costs for each pixel adjacent to a predetermined range from the parallax. Is calculated by cumulative addition,
A stereo image processing apparatus.
前記修正コスト計算処理手段は、前記注目画素からの方向ごとの信頼性を、ウィンドウコストが小さい画素が存在する方向を信頼性が高いものとして評価することを特徴とする請求項1記載のステレオ画像処理装置。   2. The stereo image according to claim 1, wherein the correction cost calculation processing unit evaluates the reliability in each direction from the target pixel as a highly reliable direction in which a pixel having a small window cost exists. Processing equipment. 前記対応点判定手段は、前記第一の画像と前記第二の画像に共通する走査線を座標軸とする探索平面を作成し、前記探索平面上の座標値が単調増加する点列の候補の中から、前記点列上の各点の前記修正コストの合計が最小となる点列を探索して対応点を求めることを特徴とする請求項1または2記載のステレオ画像処理装置。   The corresponding point determination unit creates a search plane having a scanning line common to the first image and the second image as a coordinate axis, and among the candidates of the point sequence whose coordinate values on the search plane monotonously increase 3. The stereo image processing apparatus according to claim 1, wherein a corresponding point is obtained by searching for a point sequence in which a total of the correction costs of each point on the point sequence is minimum. 第一の画像取得手段からの第一の画像と第二の画像取得手段からの第二の画像が入力される画像入力ステップと、
前記第一の画像に含まれる画素ごとに、前記第一の画像に設定される第一のウィンドウと、前記第一のウィンドウに対応して前記第二の画像に設定される第二のウィンドウとの間の非類似性に応じた評価値であるウィンドウコストを計算するウィンドウコスト計算ステップと、
前記第一の画像に含まれる画素ごとに計算されたウィンドウコストを累積加算して累積加算コストを計算する累積加算コスト計算ステップと、
前記累積加算コストを修正する修正コストを計算する修正コスト計算ステップと、
前記修正コストに基づいて前記第一のウィンドウに含まれる画素に対応する点を前記第二の画像において求め、視差データを出力する対応点判定ステップと、
前記視差データを記憶する視差データ記憶ステップと、
を有してなり、
前記ウィンドウコスト計算ステップは、前記第一のウィンドウに含まれる注目画素に対応して設定された複数の対応点候補ごとに前記第二のウィンドウを設定して前記ウィンドウコストを計算し、
前記累積加算コスト計算ステップは、前記複数の対応点候補のそれぞれに応じた視差ごとに、前記第一の画像に含まれる画素のうち前記注目画素から同じ方向上の画素のウィンドウコストを累積加算して、前記注目画素からの方向ごとに前記累積加算コストを計算し、
前記修正コスト計算ステップは、前記複数の対応点候補のそれぞれに応じた視差ごとに、前記注目画素からの方向ごとの信頼性を評価し、前記注目画素からの方向ごとに計算された前記累積加算コストを前記信頼性の低い方向の累積加算コストから順に加算して前記修正コストを計算し、
前記対応点判定ステップは、前記注目画素に対応して設定された複数の対応点候補のうち、前記修正コストが最小となる対応点候補を対応点として、前記注目画素と前記対応点との視差データを出力し、
前記累積加算コスト計算処理手段が前記複数の対応点候補のそれぞれに応じた視差ごとに計算する前記累積加算コストは、前記視差から所定の範囲に隣接する画素ごとの累積加算コストのうち最小の累積加算コストが累積加算されて計算され、
前記修正コスト計算処理手段が前記複数の対応点候補のそれぞれに応じた視差ごとに計算する前記修正コストは、前記視差から所定の範囲に隣接する画素ごとの累積加算コストのうち最小の累積加算コストが累積加算されて計算される、
ことを特徴とするステレオ画像処理方法。
An image input step in which the first image from the first image acquisition means and the second image from the second image acquisition means are input;
For each pixel included in the first image, a first window set in the first image, and a second window set in the second image corresponding to the first window; A window cost calculating step of calculating a window cost which is an evaluation value according to dissimilarity between
A cumulative addition cost calculating step of cumulatively adding a window cost calculated for each pixel included in the first image to calculate a cumulative addition cost;
A correction cost calculating step of calculating a correction cost for correcting the cumulative addition cost;
A corresponding point determination step of obtaining a point corresponding to the pixel included in the first window based on the correction cost in the second image and outputting parallax data;
A parallax data storage step for storing the parallax data;
Having
The window cost calculation step calculates the window cost by setting the second window for each of a plurality of corresponding point candidates set corresponding to the target pixel included in the first window,
The cumulative addition cost calculating step cumulatively adds window costs of pixels in the same direction from the target pixel among the pixels included in the first image for each parallax corresponding to each of the plurality of corresponding point candidates. Calculating the cumulative addition cost for each direction from the target pixel,
The correction cost calculating step evaluates reliability for each direction from the target pixel for each parallax corresponding to each of the plurality of corresponding point candidates, and calculates the cumulative addition calculated for each direction from the target pixel. Calculate the correction cost by sequentially adding the cost from the cumulative addition cost in the direction of low reliability,
In the corresponding point determination step, a disparity between the target pixel and the corresponding point is determined by using a corresponding point candidate having the minimum correction cost as a corresponding point among a plurality of corresponding point candidates set corresponding to the target pixel. Output data,
The cumulative addition cost calculated by the cumulative addition cost calculation processing unit for each parallax corresponding to each of the plurality of corresponding point candidates is a minimum cumulative cost among the cumulative addition costs for each pixel adjacent to a predetermined range from the parallax. Addition cost is calculated by accumulating,
The correction cost calculated by the correction cost calculation processing unit for each parallax corresponding to each of the plurality of corresponding point candidates is the minimum cumulative addition cost among the cumulative addition costs for each pixel adjacent to a predetermined range from the parallax. Is calculated by cumulative addition,
And a stereo image processing method.
JP2011045223A 2011-03-02 2011-03-02 Stereo image processing apparatus and stereo image processing method Active JP5682065B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011045223A JP5682065B2 (en) 2011-03-02 2011-03-02 Stereo image processing apparatus and stereo image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011045223A JP5682065B2 (en) 2011-03-02 2011-03-02 Stereo image processing apparatus and stereo image processing method

Publications (2)

Publication Number Publication Date
JP2012181142A JP2012181142A (en) 2012-09-20
JP5682065B2 true JP5682065B2 (en) 2015-03-11

Family

ID=47012451

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011045223A Active JP5682065B2 (en) 2011-03-02 2011-03-02 Stereo image processing apparatus and stereo image processing method

Country Status (1)

Country Link
JP (1) JP5682065B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10891751B2 (en) 2018-01-23 2021-01-12 Ricoh Company, Ltd. Range image generating method, range image generating apparatus, and on-board device having range image generating function

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6417886B2 (en) * 2013-12-12 2018-11-07 株式会社リコー Parallax value deriving device, moving body, robot, parallax value production method, and program
JP6321365B2 (en) * 2013-12-13 2018-05-09 株式会社Soken Corresponding point search method and distance measuring device
JP6476831B2 (en) 2013-12-26 2019-03-06 株式会社リコー Parallax calculation system, information processing apparatus, information processing method, and program
JP6481375B2 (en) 2014-02-27 2019-03-13 株式会社リコー Information processing system, information processing method, program, and information processing apparatus
JP6455164B2 (en) 2014-02-28 2019-01-23 株式会社リコー Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
JP6565188B2 (en) 2014-02-28 2019-08-28 株式会社リコー Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
JP6543935B2 (en) 2014-02-28 2019-07-17 株式会社リコー PARALLEL VALUE DERIVING DEVICE, DEVICE CONTROL SYSTEM, MOBILE OBJECT, ROBOT, PARALLEL VALUE DERIVING METHOD, AND PROGRAM
JP6515547B2 (en) * 2014-03-11 2019-05-22 株式会社リコー PARALLEL VALUE DERIVING DEVICE, DEVICE CONTROL SYSTEM, MOBILE OBJECT, ROBOT, PARALLEL VALUE PRODUCTION METHOD, AND PROGRAM
JP2015195019A (en) 2014-03-20 2015-11-05 株式会社リコー Disparity deriving apparatus, movable apparatus, robot, method of deriving disparity, method of producing disparity, and program
JP6561511B2 (en) 2014-03-20 2019-08-21 株式会社リコー Parallax value deriving device, moving body, robot, parallax value production deriving method, parallax value producing method and program
JP6561512B2 (en) 2014-03-27 2019-08-21 株式会社リコー Parallax value deriving device, moving body, robot, parallax value deriving method, parallax value producing method, and program
JP6589313B2 (en) 2014-04-11 2019-10-16 株式会社リコー Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
JP6442911B2 (en) * 2014-08-08 2018-12-26 株式会社リコー Parallax value deriving device, moving object, robot, parallax value deriving method, and program
JP2016061622A (en) * 2014-09-17 2016-04-25 株式会社リコー Information processing system and information processing method
EP3002550B1 (en) 2014-10-03 2017-08-30 Ricoh Company, Ltd. Information processing system and information processing method for distance measurement
JP6411177B2 (en) * 2014-11-07 2018-10-24 国立研究開発法人産業技術総合研究所 Stereo matching device, stereo matching program, and stereo matching method
JP2016095229A (en) * 2014-11-14 2016-05-26 株式会社リコー Parallax value derivation device, movable body, robot, parallax value production method, and program
JP6411188B2 (en) * 2014-11-26 2018-10-24 国立研究開発法人産業技術総合研究所 Stereo matching device, stereo matching program, and stereo matching method
JP6212021B2 (en) * 2014-11-26 2017-10-11 株式会社Soken Distance detector
JP2016145753A (en) * 2015-02-09 2016-08-12 国立研究開発法人情報通信研究機構 Depth estimation device, depth estimation method, and depth estimation program
KR101856344B1 (en) 2016-08-22 2018-06-25 현대자동차주식회사 System and method for generating disparity map by matching stereo images

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004234423A (en) * 2003-01-31 2004-08-19 Seiko Epson Corp Stereoscopic image processing method, stereoscopic image processor and stereoscopic image processing program
JP2007257324A (en) * 2006-03-23 2007-10-04 Space Vision:Kk Face model creating system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10891751B2 (en) 2018-01-23 2021-01-12 Ricoh Company, Ltd. Range image generating method, range image generating apparatus, and on-board device having range image generating function

Also Published As

Publication number Publication date
JP2012181142A (en) 2012-09-20

Similar Documents

Publication Publication Date Title
JP5682065B2 (en) Stereo image processing apparatus and stereo image processing method
JP7173772B2 (en) Video processing method and apparatus using depth value estimation
US8452081B2 (en) Forming 3D models using multiple images
US8447099B2 (en) Forming 3D models using two images
JP4382797B2 (en) Corresponding point search method and three-dimensional position measurement method
US9679384B2 (en) Method of detecting and describing features from an intensity image
US9165211B2 (en) Image processing apparatus and method
WO2014073670A1 (en) Image processing method and image processing device
US10607350B2 (en) Method of detecting and describing features from an intensity image
KR102400412B1 (en) Method and apparatus for generating an adapted slice image from a focal stack
US20150206307A1 (en) Visual Perception Matching Cost On Binocular Stereo Images
JP4701848B2 (en) Image matching apparatus, image matching method, and image matching program
JP6285686B2 (en) Parallax image generation device
JP6411188B2 (en) Stereo matching device, stereo matching program, and stereo matching method
JP2001266128A (en) Method and device for obtaining depth information and recording medium recording depth information obtaining program
JP6494402B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP4337203B2 (en) Distance image generating apparatus, distance image generating method, and program providing medium
JP5656018B2 (en) Sphere detection method
Kang et al. Progressive 3D model acquisition with a commodity hand-held camera
JP6456084B2 (en) Image processing apparatus, image processing method, and program
JP2003050110A (en) Three-dimensional shape data producing system and method, program and recording medium
JP6843552B2 (en) Image processing equipment, image processing methods and programs.
CN117456114B (en) Multi-view-based three-dimensional image reconstruction method and system
JP2004340714A (en) Optimum arrangement determination method of stereo camera and its system
JP2504641B2 (en) Three-dimensional shape measurement processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130904

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140326

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140422

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140620

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20141224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141225

R150 Certificate of patent or registration of utility model

Ref document number: 5682065

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250