JP5071866B2 - Distance measuring device, method and program - Google Patents

Distance measuring device, method and program Download PDF

Info

Publication number
JP5071866B2
JP5071866B2 JP2008145397A JP2008145397A JP5071866B2 JP 5071866 B2 JP5071866 B2 JP 5071866B2 JP 2008145397 A JP2008145397 A JP 2008145397A JP 2008145397 A JP2008145397 A JP 2008145397A JP 5071866 B2 JP5071866 B2 JP 5071866B2
Authority
JP
Japan
Prior art keywords
reference image
pixel
size
distance
point
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
JP2008145397A
Other languages
Japanese (ja)
Other versions
JP2009293971A (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
Fujifilm Corp
Original Assignee
National Institute of Advanced Industrial Science and Technology AIST
Fujifilm Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Institute of Advanced Industrial Science and Technology AIST, Fujifilm Corp filed Critical National Institute of Advanced Industrial Science and Technology AIST
Priority to JP2008145397A priority Critical patent/JP5071866B2/en
Publication of JP2009293971A publication Critical patent/JP2009293971A/en
Application granted granted Critical
Publication of JP5071866B2 publication Critical patent/JP5071866B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、被写体の立体形状を表す距離画像を生成する距離測定装置および方法並びに距離測定方法をコンピュータに実行させるためのプログラムに関するものである。   The present invention relates to a distance measuring device and method for generating a distance image representing a three-dimensional shape of a subject, and a program for causing a computer to execute the distance measuring method.

異なる位置に設けられた2台以上のカメラを用いて被写体を撮像し、これにより取得された複数の画像(基準カメラによる基準画像および参照カメラによる参照画像)の間で対応する画素である対応点を探索し(ステレオマッチング)、互いに対応する基準画像上の画素と、参照画像上の画素との位置の差(視差)に三角測量の原理を適用することにより、基準カメラまたは参照カメラから当該画素に対応する被写体上の点までの距離を計測して、被写体の立体形状を表す距離画像を生成する手法が提案されている。   Corresponding points that are pixels corresponding to a plurality of images (a reference image by a reference camera and a reference image by a reference camera) obtained by capturing an image of a subject using two or more cameras provided at different positions (Stereo matching) and applying the triangulation principle to the position difference (parallax) between the corresponding pixel on the reference image and the pixel on the reference image, the pixel from the reference camera or reference camera A method has been proposed in which a distance image representing a three-dimensional shape of a subject is generated by measuring the distance to a point on the subject corresponding to.

ここで、ステレオマッチングを行う際には、図3に示すように、基準画像G1上のある画素Qaに写像される実空間上の点は、点Q1,Q2,Q3…というように点O1からの視線上に連続的に複数存在するため、実空間上の点Q1 ,Q2 ,Q3… 等の写像である直線(エピポーラ線)上に、画素Qaに対応する参照画像G2上の画素Qa′が存在することに基づいて対応点が探索される。なお、図3において点O1は基準カメラの視点、点O2は参照カメラの視点である。ここで、視点とは各カメラの光学系の焦点である。このようにステレオマッチングを行う際には、基準画像上に対応点探索の対象となる画素Qaを含む相関ウィンドウWを設定し、参照画像上において基準画像に設定したものと同一の相関ウィンドウWをエピポーラ線上に沿って移動し、移動位置毎に各画像上の相関ウィンドウ内の各画素についての相関を算出し、参照画像G2上における相関が最大となる相関ウィンドウの中央の位置にある画素を、画素Qaの対応点として求めている。   Here, when performing stereo matching, as shown in FIG. 3, the points in the real space mapped to a certain pixel Qa on the reference image G1 are points Q1, Q2, Q3,. Since there are a plurality of continuous lines on the line of sight, the pixel Qa ′ on the reference image G2 corresponding to the pixel Qa is on a straight line (epipolar line) that is a map of the points Q1, Q2, Q3. Corresponding points are searched based on the existence. In FIG. 3, the point O1 is the viewpoint of the base camera, and the point O2 is the viewpoint of the reference camera. Here, the viewpoint is the focal point of the optical system of each camera. When performing stereo matching in this way, a correlation window W including a pixel Qa to be searched for corresponding points is set on the reference image, and the same correlation window W as that set for the reference image is set on the reference image. It moves along the epipolar line, calculates the correlation for each pixel in the correlation window on each image for each movement position, and determines the pixel at the center of the correlation window where the correlation on the reference image G2 is maximum, It is obtained as a corresponding point of the pixel Qa.

このように対応点を探索する際には、適切なサイズの相関ウィンドウを用いることにより対応点の探索精度が向上する。このため、基準画像と参照画像との類似度を表すエネルギー関数の期待値と、基準画像上の画素と参照画像上の画素との視差の確率から定められるエントロピーとから信頼度パラメータを算出し、信頼度パラメータに基づいて相関ウィンドウのサイズを決定する手法が提案されている(特許文献1参照)。また、基準画像および参照画像において2つの輝度レベルを設定し、2つの輝度レベルの間にある画像群を対応点探索のための比較領域とする手法が提案されている(特許文献2参照)。また、時系列データを対象として対応点探索のための相関を算出するに際し、相関が悪化した場合に、相関ウィンドウのサイズを大きくする手法が提案されている(特許文献3参照)。さらに、相関ウィンドウに含まれる画素毎の視差のばらつきを示す評価関数を作成し、相関ウィンドウのサイズを変化させながら評価関数の値を算出し、算出された値を最小とするサイズの相関ウィンドウを用いる手法も提案されている(非特許文献1参照)。
特開平5−256613号公報 特開2000−28354号公報 特開平11−120351号公報 T.Kanade and M.Okumtomi, "A stereo Matching Algorithm with an Adaptive Window: Theory and Experiment", Proc.of the 1991 IEEE Intl.Conf. on Robotics and Automation, 1991, pp.1088-1095
When searching for corresponding points in this way, the search accuracy of corresponding points is improved by using a correlation window of an appropriate size. Therefore, the reliability parameter is calculated from the expected value of the energy function representing the similarity between the standard image and the reference image, and the entropy determined from the parallax probability between the pixel on the standard image and the pixel on the reference image, A method of determining the size of the correlation window based on the reliability parameter has been proposed (see Patent Document 1). In addition, a technique has been proposed in which two luminance levels are set in the standard image and the reference image, and an image group between the two luminance levels is used as a comparison area for searching for corresponding points (see Patent Document 2). Also, a method has been proposed for increasing the size of the correlation window when the correlation deteriorates when calculating the correlation for corresponding point search for time series data (see Patent Document 3). In addition, an evaluation function indicating the variation in parallax for each pixel included in the correlation window is created, the value of the evaluation function is calculated while changing the size of the correlation window, and a correlation window having a size that minimizes the calculated value is calculated. A technique to be used has also been proposed (see Non-Patent Document 1).
JP-A-5-256613 JP 2000-28354 A JP-A-11-120351 T. Kanade and M. Okutomi, "A stereo Matching Algorithm with an Adaptive Window: Theory and Experiment", Proc. Of the 1991 IEEE Intl. Conf. On Robotics and Automation, 1991, pp.1088-1095

しかしながら、上記特許文献1に記載された手法では、信頼度パラメータを最大化するための条件を算出することが難しく、演算量が膨大なものとなる。また、基準画像および参照画像において、輝度が等しい領域が必ずしも視差に対応する領域とはならないため、特許文献2に記載された手法では距離画像を精度よく算出することができない。また、特許文献3に記載された手法においては時系列データを対象としているため、静止画像を扱う場合には適用することができない。さらに、非特許文献1に記載された手法においては、評価関数を各相関ウィンドウのサイズ毎に算出する必要があるため、演算量が膨大なものとなる。   However, with the method described in Patent Document 1, it is difficult to calculate the conditions for maximizing the reliability parameter, and the amount of calculation becomes enormous. In addition, in the standard image and the reference image, regions having the same luminance are not necessarily regions corresponding to parallax, and therefore the distance image cannot be calculated with the technique described in Patent Document 2. Moreover, since the method described in Patent Document 3 is intended for time-series data, it cannot be applied when handling still images. Furthermore, in the method described in Non-Patent Document 1, it is necessary to calculate the evaluation function for each size of each correlation window, so that the amount of calculation is enormous.

本発明は上記事情に鑑みなされたものであり、精度よく対応点を探索するための相関ウィンドウのサイズを、簡易に算出することを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to easily calculate the size of a correlation window for searching for corresponding points with high accuracy.

本発明による距離測定装置は、被写体を撮像することにより取得された、該被写体上の着目点までの距離を算出するための基準画像、および該基準画像を取得した位置とは異なる位置から前記被写体を撮像することにより取得された、前記距離を算出するための少なくとも1つの参照画像の入力を受け付ける入力手段と、
前記基準画像上の着目点が投影された対象点について、該基準画像上の所定方向に延在する、該対象点を中心とする探索画素列であって、該探索画素列内の画素における輝度値の最大値と最小値との差分値が所定輝度間隔を超える探索画素列を設定し、該探索画素列の画素数を、前記対象点に対する前記参照画像上の対応点を探索する際に使用される、前記基準画像および前記参照画像の相関を算出する基準となる相関ウィンドウのサイズに設定するウィンドウサイズ設定手段と、
前記基準画像上に設定された相関ウィンドウ内の各画素と、前記参照画像上に設定された相関ウィンドウ内の各画素との相関を算出することにより、前記対応点を探索する対応点探索手段と、
該探索した対応点に基づいて前記距離を算出する距離算出手段とを備えたことを特徴とするものである。
The distance measuring device according to the present invention provides a reference image for calculating a distance to a point of interest on the subject obtained by imaging the subject, and the subject from a position different from the position from which the reference image is obtained. Input means for receiving an input of at least one reference image for calculating the distance acquired by imaging
A target pixel point on the reference image on which the point of interest is projected, and a search pixel array centered on the target point and extending in a predetermined direction on the reference image, and the luminance of the pixels in the search pixel array A search pixel sequence in which a difference value between a maximum value and a minimum value exceeds a predetermined luminance interval is used, and the number of pixels in the search pixel sequence is used when searching for a corresponding point on the reference image with respect to the target point A window size setting means for setting a correlation window size as a reference for calculating a correlation between the reference image and the reference image;
Corresponding point search means for searching for the corresponding point by calculating a correlation between each pixel in the correlation window set on the reference image and each pixel in the correlation window set on the reference image; ,
And a distance calculating means for calculating the distance based on the searched corresponding points.

画像上における輝度変化が大きい場合、画像のエッジ成分であることが多いことから、相関ウィンドウのサイズが小さくても、精度よく相関を算出することができる。また、相関ウィンドウのサイズが小さいと相関算出のための演算量が少なくなる。一方、画像上における輝度変化が小さい場合、画像上の平坦部であることが多いため、相関ウィンドウのサイズを大きくしないと、精度よく相関を算出することができない。   When the luminance change on the image is large, it is often an edge component of the image, so that the correlation can be accurately calculated even if the size of the correlation window is small. In addition, when the size of the correlation window is small, the amount of calculation for calculating the correlation decreases. On the other hand, when the luminance change on the image is small, it is often a flat portion on the image, and therefore the correlation cannot be accurately calculated unless the size of the correlation window is increased.

本発明による距離測定装置は、基準画像上の対象点について、基準画像上の所定方向に延在する、対象点を中心とする探索画素列であって、探索画素列内の画素における輝度値の最大値と最小値との差分値が所定輝度間隔を超える探索画素列を設定し、探索画素列の画素数を、対象点に対する参照画像上の対応点を探索する際に使用される、基準画像および参照画像の相関を算出する基準となる相関ウィンドウのサイズに設定するようにしたものである。このため、基準画像上の所定方向において、輝度変化が小さい対象点ほど大きいサイズの相関ウィンドウが設定されることとなり、その結果、輝度の変化量に応じた適切なサイズの相関ウィンドウを設定することができる。また、相関ウィンドウ内の各画素の輝度が必ず所定輝度間隔を有するものとなるため、相関を精度よく算出することができる。したがって、簡易な演算により相関ウィンドウのサイズを適切に設定することができるとともに、対応点探索の精度を向上させることができる。   A distance measuring device according to the present invention is a search pixel sequence centered on a target point and extending in a predetermined direction on the reference image for a target point on the reference image. A reference image that is used when a search pixel sequence in which a difference value between a maximum value and a minimum value exceeds a predetermined luminance interval and the number of pixels in the search pixel sequence is searched for a corresponding point on the reference image with respect to the target point And the size of the correlation window serving as a reference for calculating the correlation of the reference image. For this reason, in a predetermined direction on the reference image, a correlation window having a larger size is set for a target point having a smaller luminance change, and as a result, a correlation window having an appropriate size corresponding to the amount of change in luminance is set. Can do. Further, since the luminance of each pixel in the correlation window always has a predetermined luminance interval, the correlation can be calculated with high accuracy. Accordingly, the size of the correlation window can be appropriately set by simple calculation, and the accuracy of the corresponding point search can be improved.

なお、本発明による距離測定装置においては、前記ウィンドウサイズ設定手段を、初期サイズの前記探索画素列を設定し、該探索画素列内の画素における輝度値の最大値と最小値との差分値を算出し、該差分値が前記所定輝度間隔を超えるか否かを判定し、該判定が否定された場合は前記探索画素列を前記所定方向にあらかじめ定められた画素数分大きくし、前記差分値が前記所定輝度間隔を超えるまで、前記探索画素列を大きくする処理を繰り返す手段としてもよい。   In the distance measuring device according to the present invention, the window size setting means sets the search pixel column having an initial size, and calculates a difference value between a maximum value and a minimum value of luminance values in pixels in the search pixel column. Calculating and determining whether or not the difference value exceeds the predetermined luminance interval. If the determination is negative, the search pixel string is increased by a predetermined number of pixels in the predetermined direction, and the difference value is calculated. It is good also as a means to repeat the process which enlarges the said search pixel row | line until it exceeds the said predetermined brightness | luminance interval.

また、本発明による距離測定装置においては、前記所定方向を、前記基準画像の各画素を前記参照画像に写像することにより得られるエピポーラ線が延在する方向に対応する方向としてもよい。   In the distance measuring apparatus according to the present invention, the predetermined direction may be a direction corresponding to a direction in which an epipolar line obtained by mapping each pixel of the base image to the reference image extends.

これにより、対応点を探索する方向における輝度の変化を反映させて相関ウィンドウのサイズを設定することができるため、対応点探索の精度をより向上させることができる。   As a result, the size of the correlation window can be set by reflecting the change in luminance in the direction in which the corresponding points are searched, so that the accuracy of the corresponding point search can be further improved.

また、本発明による距離測定装置においては、前記ウィンドウサイズ設定手段を、前記基準画像における輝度のばらつきに応じて、前記所定輝度間隔を設定する手段としてもよい。   In the distance measuring apparatus according to the present invention, the window size setting unit may be a unit that sets the predetermined luminance interval according to a luminance variation in the reference image.

これにより、基準画像の輝度のばらつきの影響を相関ウィンドウのサイズの設定の処理から除去することができるため、基準画像の輝度のばらつきに影響されることなく、精度よく対応点を探索可能なサイズの相関ウィンドウを設定することができる。   As a result, the influence of the luminance variation of the reference image can be removed from the process of setting the size of the correlation window, so that the corresponding point can be searched for accurately without being affected by the luminance variation of the reference image. The correlation window can be set.

また、本発明による距離測定装置においては、前記ウィンドウサイズ設定手段を、前記対象点の輝度が低いほど前記所定輝度間隔を小さくするように設定する手段としてもよい。   In the distance measuring device according to the present invention, the window size setting unit may be a unit that sets the predetermined luminance interval to be smaller as the luminance of the target point is lower.

これにより、光ショットノイズのように高い輝度において変動レベルが異なるばらつきの影響を、相関ウィンドウのサイズの設定の処理から除去することができるため、精度よく対応点を探索可能なサイズの相関ウィンドウを設定することができる。   As a result, the influence of variations with different fluctuation levels at high brightness, such as light shot noise, can be removed from the processing for setting the size of the correlation window. Can be set.

また、本発明による距離測定装置においては、前記対応点探索手段を、前記探索された対応点が誤対応点であるか否かを判定し、誤対応点であると判定された画素については、前記相関ウィンドウのサイズを大きくして再度前記対応点の探索を行う手段としてもよい。   Further, in the distance measuring device according to the present invention, the corresponding point searching means determines whether or not the searched corresponding point is an incorrect corresponding point, and for a pixel determined to be an incorrect corresponding point, The correlation window may be enlarged and the corresponding points may be searched again.

これにより、演算量は多くなるものの、対応点探索の精度を向上させることができる。   Thereby, although the calculation amount increases, the accuracy of the corresponding point search can be improved.

また、本発明による距離測定装置においては、前記基準画像の全画素について前記距離を算出するよう前記ウィンドウサイズ設定手段、前記対応点探索手段および前記距離算出手段を制御する制御手段と、
前記基準画像の各画素の距離を画素値とする距離画像を生成する距離画像生成手段とをさらに備えるものとしてもよい。
Further, in the distance measuring device according to the present invention, a control means for controlling the window size setting means, the corresponding point search means and the distance calculation means so as to calculate the distance for all the pixels of the reference image,
A distance image generating unit that generates a distance image having a pixel value as a distance of each pixel of the reference image may be further provided.

これにより、精度良く距離画像を生成することができる。   Thereby, a distance image can be generated with high accuracy.

また、本発明による距離測定装置においては、前記対応点探索手段を、同一サイズの前記相関ウィンドウが設定された画素毎に、該相関ウィンドウのサイズが小さい順に、前記対応点をまとめて探索する手段としてもよい。   Further, in the distance measuring device according to the present invention, the corresponding point searching means searches for the corresponding points collectively for each pixel in which the correlation window of the same size is set in ascending order of the size of the correlation window. It is good.

これにより、対応点を効率よく探索することができる。   Thereby, a corresponding point can be searched efficiently.

また、この場合、前記対応点探索手段を、一のサイズの前記相関ウィンドウを用いて探索された対応点のうち、誤対応となる誤対応点が探索された前記基準画像の画素については、前記相関ウィンドウのサイズを一段階大きくし、該一段階大きいサイズの前記相関ウィンドウが設定された画素とともに前記対応点を探索する手段としてもよい。   Further, in this case, the corresponding point search unit may be configured to search for a pixel of the reference image in which a miscorresponding point that is miscorresponding is searched out of corresponding points searched using the correlation window of one size. The size of the correlation window may be increased by one step, and the corresponding points may be searched together with the pixels in which the correlation window having the size larger by one step is set.

これにより、次のサイズの相関ウィンドウを用いた対応点の探索の際に、誤対応点について再度の対応点の探索がなされることから、誤対応点についてのみ単独で対応点の探索を行う必要がなくなるため、誤対応点について効率よく対応点を探索できるとともに、対応点探索の精度を向上させることができる。   As a result, when searching for corresponding points using a correlation window of the next size, the corresponding points are searched again for the incorrect corresponding points, so it is necessary to search the corresponding points independently only for the incorrect corresponding points. Therefore, corresponding points can be efficiently searched for erroneous corresponding points, and the accuracy of the corresponding point search can be improved.

また、本発明による距離測定装置においては、前記ウィンドウサイズ設定手段を、前記相関ウィンドウのサイズを所定の複数のサイズ群に分類し、前記各画素の前記相関ウィンドウのサイズを、該各画素について設定した相関ウィンドウのサイズが分類された前記サイズ群における最大サイズに再設定する手段としてもよい。   Further, in the distance measuring device according to the present invention, the window size setting means classifies the size of the correlation window into a plurality of predetermined size groups, and sets the size of the correlation window of each pixel for each pixel. The correlation window size may be reset to the maximum size in the classified size group.

これにより、効率よく対応点を探索することができる。   Thereby, a corresponding point can be searched efficiently.

本発明による距離測定方法は、被写体を撮像することにより取得された、該被写体上の着目点までの距離を算出するための基準画像、および該基準画像を取得した位置とは異なる位置から前記被写体を撮像することにより取得された、前記距離を算出するための少なくとも1つの参照画像の入力を受け付け、
前記基準画像上の着目点が投影された対象点について、該基準画像上の所定方向に延在する、該対象点を中心とする探索画素列であって、該探索画素列内の画素における輝度値の最大値と最小値との差分値が所定輝度間隔を超える探索画素列を設定し、該探索画素列の画素数を、前記対象点に対する前記参照画像上の対応点を探索する際に使用される、前記基準画像および前記参照画像の相関を算出する基準となる相関ウィンドウのサイズに設定し、
前記基準画像上に設定された相関ウィンドウ内の各画素と、前記参照画像上に設定された相関ウィンドウ内の各画素との相関を算出することにより、前記対応点を探索し、
該探索した対応点に基づいて前記距離を算出することを特徴とするものである。
The distance measurement method according to the present invention includes a reference image for calculating a distance to a point of interest on the subject obtained by imaging the subject, and the subject from a position different from the position from which the reference image is obtained. Accepting input of at least one reference image for calculating the distance obtained by imaging
A target pixel point on the reference image on which the point of interest is projected, and a search pixel array centered on the target point and extending in a predetermined direction on the reference image, and the luminance of the pixels in the search pixel array A search pixel sequence in which a difference value between a maximum value and a minimum value exceeds a predetermined luminance interval is used, and the number of pixels in the search pixel sequence is used when searching for a corresponding point on the reference image with respect to the target point Is set to the size of a correlation window serving as a reference for calculating the correlation between the reference image and the reference image,
By searching for the corresponding points by calculating the correlation between each pixel in the correlation window set on the reference image and each pixel in the correlation window set on the reference image,
The distance is calculated based on the searched corresponding points.

なお、本発明による距離測定方法をコンピュータに実行させるためのプログラムとして提供してもよい。   In addition, you may provide as a program for making a computer perform the distance measuring method by this invention.

以下、図面を参照して本発明の実施形態について説明する。図1は本発明の第1の実施形態による距離測定装置を適用した立体撮像装置1の内部構成を示す概略ブロック図である。図1に示すように第1の実施形態による立体撮像装置1は、2つの撮像部21A,21B、撮像制御部22、画像処理部23、圧縮/伸長処理部24、フレームメモリ25、メディア制御部26、内部メモリ27、および表示制御部28を備える。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a schematic block diagram showing an internal configuration of a stereoscopic imaging apparatus 1 to which a distance measuring device according to a first embodiment of the present invention is applied. As shown in FIG. 1, the stereoscopic imaging apparatus 1 according to the first embodiment includes two imaging units 21A and 21B, an imaging control unit 22, an image processing unit 23, a compression / decompression processing unit 24, a frame memory 25, and a media control unit. 26, an internal memory 27, and a display control unit 28.

図2は撮像部21A,21Bの構成を示す図である。図2に示すように、撮像部21A,21Bは、レンズ10A,10B、絞り11A,11B、シャッタ12A,12B、CCD13A,13B、アナログフロントエンド(AFE)14A,14BおよびA/D変換部15A,15Bをそれぞれ備える。   FIG. 2 is a diagram illustrating the configuration of the imaging units 21A and 21B. As shown in FIG. 2, the imaging units 21A and 21B include lenses 10A and 10B, diaphragms 11A and 11B, shutters 12A and 12B, CCDs 13A and 13B, analog front ends (AFE) 14A and 14B, and an A / D conversion unit 15A. 15B is provided.

レンズ10A,10Bは、被写体に焦点を合わせるためのフォーカスレンズ、ズーム機能を実現するためのズームレンズ等の複数の機能別レンズにより構成され、不図示のレンズ駆動部によりその位置が調整される。なお、本実施形態においては焦点位置は固定されているものとする。   The lenses 10A and 10B are composed of a plurality of functional lenses such as a focus lens for focusing on a subject and a zoom lens for realizing a zoom function, and their positions are adjusted by a lens driving unit (not shown). In the present embodiment, the focal position is assumed to be fixed.

絞り11A,11Bは、不図示の絞り駆動部により、AE処理により得られる絞り値データに基づいて絞り径の調整が行われる。なお、本実施形態においては絞り値データは固定されているものとする。   In the diaphragms 11A and 11B, the diaphragm diameter is adjusted based on the diaphragm value data obtained by the AE process by a diaphragm driving unit (not shown). In the present embodiment, it is assumed that the aperture value data is fixed.

シャッタ12A,12Bはメカニカルシャッタであり、不図示のシャッタ駆動部により、AE処理により得られるシャッタスピードに応じて駆動される。なお、本実施形態においてはシャッタスピードは固定されているものとする。   The shutters 12A and 12B are mechanical shutters, and are driven by a shutter driving unit (not shown) according to the shutter speed obtained by the AE process. In this embodiment, the shutter speed is assumed to be fixed.

CCD13A,13Bは、多数の受光素子を2次元的に配列した光電面を有しており、被写体光がこの光電面に結像して光電変換されてアナログ撮像信号が取得される。また、CCD13A,13Bの前面にはR,G,B各色のフィルタが規則的に配列されたカラーフィルタが配設されている。   The CCDs 13A and 13B have a photoelectric surface in which a large number of light receiving elements are two-dimensionally arranged, and subject light is imaged on the photoelectric surface and subjected to photoelectric conversion to obtain an analog imaging signal. In addition, color filters in which R, G, and B color filters are regularly arranged are arranged on the front surfaces of the CCDs 13A and 13B.

AFE14A,14Bは、CCD13A,13Bから出力されるアナログ撮像信号に対して、アナログ撮像信号のノイズを除去する処理、およびアナログ撮像信号のゲインを調節する処理(以下アナログ処理とする)を施す。   The AFEs 14A and 14B perform processing for removing noise of the analog imaging signal and processing for adjusting the gain of the analog imaging signal (hereinafter referred to as analog processing) for the analog imaging signals output from the CCDs 13A and 13B.

A/D変換部15A,15Bは、AFE14A,14Bによりアナログ処理が施されたアナログ撮像信号をデジタル信号に変換する。なお、撮像部21A,21BのCCD13A,13Bにおいて取得され、デジタル信号に変換されることにより得られる画像データは、画素毎にR,G,Bの濃度値を持つRAWデータである。なお、撮像部21Aにより取得される画像データにより表される画像を基準画像G1、撮像部21Bにより取得される画像データにより表される画像を参照画像G2とする。   The A / D converters 15A and 15B convert the analog imaging signals subjected to analog processing by the AFEs 14A and 14B into digital signals. Note that image data obtained by the CCDs 13A and 13B of the imaging units 21A and 21B and converted into digital signals is RAW data having R, G, and B density values for each pixel. The image represented by the image data acquired by the imaging unit 21A is referred to as a standard image G1, and the image represented by the image data acquired by the imaging unit 21B is referred to as a reference image G2.

撮像制御部22は、レリーズボタン押下後に撮像の制御を行う。   The imaging control unit 22 controls imaging after pressing the release button.

なお、本実施形態においては、焦点位置、絞り値データおよびシャッタスピードは固定されているが、AF処理およびAE処理を行って、撮影の都度、焦点位置、絞り値データおよびシャッタスピードを設定するようにしてもよい。この場合、焦点位置、絞り値データおよびシャッタスピードについて基準となる値と、被写体までの距離および撮影環境の明るさに応じて異なる焦点位置、絞り値データおよびシャッタスピードを記録したテーブルを内部メモリ27に記憶しておき、AF処理およびAE処理により得られる被写体までの距離および撮影環境の明るさに応じてこのテーブルを参照して、焦点位置、絞り値データおよびシャッタスピードを設定するようにしてもよい。   In this embodiment, the focus position, aperture value data, and shutter speed are fixed, but AF processing and AE processing are performed to set the focus position, aperture value data, and shutter speed each time shooting is performed. It may be. In this case, the internal memory 27 stores a table that records reference values for the focus position, aperture value data, and shutter speed, and the focus position, aperture value data, and shutter speed that differ depending on the distance to the subject and the brightness of the shooting environment. The focal position, aperture value data, and shutter speed may be set by referring to this table in accordance with the distance to the subject obtained by AF processing and AE processing and the brightness of the shooting environment. Good.

画像処理部23は、撮像部21A,21Bが取得したデジタルの画像データに対して、画像データの感度分布のばらつきおよび光学系の歪みを補正する補正処理を施すとともに、2つの画像を並行化するための並行化処理を施す。これらの処理後の基準画像および参照画像の参照符号を、それぞれG1a、G2aとする。画像処理部23は、さらに、基準画像G1aおよび参照画像G2aに対してホワイトバランスを調整する処理、階調補正、シャープネス補正、および色補正等の画像処理を施す。この画像処理により得られる基準画像および参照画像の参照符号を、それぞれG1b、G2bとする。   The image processing unit 23 performs correction processing for correcting variations in sensitivity distribution of the image data and distortion of the optical system on the digital image data acquired by the imaging units 21A and 21B, and parallelizes the two images. For parallel processing. The reference numerals of the base image and the reference image after these processes are G1a and G2a, respectively. The image processing unit 23 further performs image processing such as white balance adjustment processing, gradation correction, sharpness correction, and color correction on the base image G1a and the reference image G2a. The reference codes of the base image and the reference image obtained by this image processing are G1b and G2b, respectively.

圧縮/伸長処理部24は、画像処理部23によって処理が施された基準画像G1a,G1bおよび参照画像G2a,G2bを表す画像データ並びに後述するように生成された距離画像の画像データに対して、例えば、JPEG等の圧縮形式で圧縮処理を行い、画像ファイルを生成する。この画像ファイルには、Exifフォーマット等に基づいて、撮影日時等の付帯情報が格納されたタグが付加される。   The compression / decompression processing unit 24 applies to the image data representing the base images G1a and G1b and the reference images G2a and G2b processed by the image processing unit 23 and the image data of the distance image generated as described later. For example, compression processing is performed in a compression format such as JPEG to generate an image file. A tag storing incidental information such as shooting date and time is added to the image file based on the Exif format or the like.

フレームメモリ25は、撮像部2Aが取得した距離画像用のデータ、および撮像部21A,21Bが取得した基準画像G1および参照画像G2を表す画像データに対して、前述の画像処理部23が行う処理を含む各種処理を行う際に使用する作業用メモリである。   The frame memory 25 performs processing performed by the image processing unit 23 on the distance image data acquired by the imaging unit 2A and the image data representing the reference image G1 and the reference image G2 acquired by the imaging units 21A and 21B. This is a working memory used when performing various processes including.

メディア制御部26は、記録メディア29にアクセスして距離画像等の画像ファイルの書き込みと読み込みの制御を行う。   The media control unit 26 accesses the recording medium 29 and controls writing and reading of an image file such as a distance image.

内部メモリ27は、ステレオカメラ2において設定される各種定数、およびCPU33が実行するプログラム等を記憶する。   The internal memory 27 stores various constants set in the stereo camera 2, a program executed by the CPU 33, and the like.

表示制御部28は、フレームメモリ25に格納された画像データをモニタ20に表示させたり、記録メディア29に記録されている画像をモニタ20に表示させたりするためのものである。   The display control unit 28 is for displaying image data stored in the frame memory 25 on the monitor 20 and displaying an image recorded on the recording medium 29 on the monitor 20.

また、立体撮像装置1は、ステレオマッチング部30、距離画像生成部31およびウィンドウサイズ設定部32を備える。   In addition, the stereoscopic imaging device 1 includes a stereo matching unit 30, a distance image generation unit 31, and a window size setting unit 32.

ステレオマッチング部30は、図3に示すように、基準画像G1上のある画素Qaに写像される実空間上の点は、点Q1,Q2,Q3…というように点O1からの視線上に連続的に複数存在するため、実空間上の点Q1 ,Q2 ,Q3… 等の写像である直線(エピポーラ線)上に、画素Qaに対応する参照画像R上の画素Qa′が存在するということに基づいて、基準画像G1と参照画像G2との対応点を参照画像G2上において探索する。なお、図3において点O1は基準カメラとなる撮像部21Aの視点、点O2は参照カメラとなる撮像部21Bの視点である。ここで、視点とは撮像部21A,21Bの光学系の焦点である。また、点O1,O2を結ぶ直線と、基準画像G1,G2との交点O3,O4がエピポールである。また、対応点の探索は、画像処理が施された基準画像G1bおよび参照画像G2bを用いてもよいが、並行化処理までの処理が施された基準画像G1aおよび参照画像G2aを用いることが好ましい。以降では、対応点の探索は基準画像G1aおよび参照画像G2aを用いるものとして説明する。   As shown in FIG. 3, in the stereo matching unit 30, the points in the real space mapped to a certain pixel Qa on the reference image G1 are continuous on the line of sight from the point O1, such as points Q1, Q2, Q3. Therefore, the pixel Qa ′ on the reference image R corresponding to the pixel Qa exists on a straight line (epipolar line) that is a mapping of the points Q1, Q2, Q3. Based on the reference image G2, the corresponding point between the base image G1 and the reference image G2 is searched. In FIG. 3, a point O1 is a viewpoint of the imaging unit 21A that is a reference camera, and a point O2 is a viewpoint of the imaging unit 21B that is a reference camera. Here, the viewpoint is the focal point of the optical system of the imaging units 21A and 21B. Further, the intersections O3 and O4 between the straight line connecting the points O1 and O2 and the reference images G1 and G2 are epipoles. The search for corresponding points may use the standard image G1b and the reference image G2b that have been subjected to the image processing, but it is preferable to use the standard image G1a and the reference image G2a that have been processed up to the parallel processing. . In the following description, it is assumed that the search for corresponding points uses the base image G1a and the reference image G2a.

具体的には、ステレオマッチング部30は、対応点の探索を行う際に、後述するウィンドウサイズ設定部32が設定したサイズの相関ウィンドウWをエピポーラ線に沿って移動し、各移動位置において基準画像G1aおよび参照画像G2aの相関ウィンドウW内の画素についての相関を算出し、参照画像G2a上の相関が最大となる位置における相関ウィンドウWの中心画素を、基準画像G1a上の画素Qaに対応する対応点とする。なお、相関を評価するための相関評価値としては、差分絶対値和および差分2乗和等を用いることができる。この場合、相関評価値が小さいほど、相関が大きいものとなる。   Specifically, when searching for corresponding points, the stereo matching unit 30 moves the correlation window W having a size set by a window size setting unit 32 described later along the epipolar line, and at each moving position, the reference image Correlation for pixels in the correlation window W of G1a and reference image G2a is calculated, and the center pixel of the correlation window W at the position where the correlation on the reference image G2a is maximum corresponds to the pixel Qa on the reference image G1a Let it be a point. In addition, as a correlation evaluation value for evaluating a correlation, a difference absolute value sum, a difference square sum, etc. can be used. In this case, the smaller the correlation evaluation value, the larger the correlation.

図4は並行化処理後の基準画像および参照画像の位置関係を説明するための図である。図4に示すように、撮像部21A,21Bにおける基準画像G1aおよび参照画像G2aが得られる面となる画像面を、撮像部21A,21Bの光軸とそれぞれ直交し、光軸との交点を原点とする座標系(u,v)、(u′,v′)とする。ここで、並行化処理により撮像部21A,21Bの光軸は平行となり、2つの画像面は同一平面上にあり、画像面におけるu軸およびu′軸は同一直線上において同一方向を向くこととなる。また、並行化処理により、参照画像G2a上におけるエピポーラ線は、u′軸に平行なものとなるため、基準画像G1a上におけるu軸も、参照画像G2aのエピポーラ線の方向と一致することとなる。   FIG. 4 is a diagram for explaining the positional relationship between the base image and the reference image after the parallel processing. As shown in FIG. 4, the image planes from which the standard images G1a and the reference images G2a are obtained in the imaging units 21A and 21B are orthogonal to the optical axes of the imaging units 21A and 21B, and the intersection point with the optical axis is the origin. Coordinate systems (u, v) and (u ′, v ′). Here, by the parallel processing, the optical axes of the imaging units 21A and 21B are parallel, the two image planes are on the same plane, and the u axis and the u ′ axis on the image plane face the same direction on the same straight line. Become. Further, since the epipolar line on the reference image G2a is parallel to the u ′ axis by the parallelization process, the u axis on the reference image G1a also coincides with the direction of the epipolar line of the reference image G2a. .

ここで、撮像部21A,21Bの焦点距離をf、基線長をbとする。なお、焦点距離fおよび基線長bはキャリブレーションパラメータとしてあらかじめ算出されて内部メモリ27に記憶されている。このとき、3次元空間上における位置(X,Y,Z)は、撮像部21Aの座標系を基準とすると、下記の式(1)〜(3)により表される。   Here, it is assumed that the focal lengths of the imaging units 21A and 21B are f and the base line length is b. The focal length f and the base line length b are calculated in advance as calibration parameters and stored in the internal memory 27. At this time, the position (X, Y, Z) in the three-dimensional space is expressed by the following equations (1) to (3) with reference to the coordinate system of the imaging unit 21A.

X=b・u/(u−u′) (1)
Y=b・v/(u−u′) (2)
Z=b・f/(u−u′) (3)
ここでu−u′は、撮像部21A,21Bの画像面上における投影点の横方向のずれ量(視差)である。また、式(3)より、奥行きである距離Zは視差に反比例することが分かる。
X = b · u / (u−u ′) (1)
Y = b · v / (u−u ′) (2)
Z = b · f / (u−u ′) (3)
Here, u−u ′ is the amount of deviation (parallax) in the horizontal direction of the projection point on the image plane of the imaging units 21A and 21B. Further, it can be seen from the expression (3) that the distance Z, which is the depth, is inversely proportional to the parallax.

距離画像生成部31は、ステレオマッチング部30が求めた対応点を用いて、上記式(1)〜(3)により、撮像部21A,21Bから被写体までの距離を算出し、算出された距離をCCD13B,13Cの各画素と対応づけて距離画像D1を生成する。なお、距離画像D1の各画素の画素値が撮像部21A,21Bから被写体までの距離を表すものとなる。生成された距離画像D1は記録メディア29に記録される。   The distance image generation unit 31 uses the corresponding points obtained by the stereo matching unit 30 to calculate the distances from the imaging units 21A and 21B to the subject by the above formulas (1) to (3), and calculates the calculated distance. A distance image D1 is generated in association with each pixel of the CCDs 13B and 13C. Note that the pixel value of each pixel of the distance image D1 represents the distance from the imaging units 21A and 21B to the subject. The generated distance image D1 is recorded on the recording medium 29.

ウィンドウサイズ設定部32は、対応点を探索する際に使用する相関ウィンドウのサイズを設定する。図5は基準画像G1aのu軸方向のある1ラインにおける輝度のプロファイルを示す図である。本実施形態においては、基準画像G1a上の、参照画像G2aのエピポーラ線が延在する方向における輝度の変化に応じて、相関ウィンドウのサイズを設定するものである。ここで、基準画像G1aおよび参照画像G2aは並行化処理されているため、基準画像G1aにおける参照画像G2aのエピポーラ線が延在する方向に対応する方向はu軸方向となる。   The window size setting unit 32 sets the size of the correlation window used when searching for corresponding points. FIG. 5 is a diagram showing a luminance profile in one line in the u-axis direction of the reference image G1a. In the present embodiment, the size of the correlation window is set according to a change in luminance in the direction in which the epipolar line of the reference image G2a extends on the standard image G1a. Here, since the standard image G1a and the reference image G2a are processed in parallel, the direction corresponding to the direction in which the epipolar line of the reference image G2a in the standard image G1a extends is the u-axis direction.

なお、並行化処理前においては、相関ウィンドウのサイズを定める方向は、画像中の画素が並ぶ方向とは一致しない。この場合、相関ウィンドウのサイズを定める方向は、基準画像G1上における対象画素とエピポールとを結ぶ直線の方向(エピポーラ線が延在する方向)となる。なお、対象画素とエピポールとを結ぶ直線の方向は、並行化処理により画像中の画素が並ぶ方向(基準画像G1a上におけるu軸方向)と一致するものとなる。   Note that before the parallel processing, the direction in which the size of the correlation window is determined does not match the direction in which the pixels in the image are arranged. In this case, the direction for determining the size of the correlation window is the direction of the straight line connecting the target pixel and the epipole on the reference image G1 (the direction in which the epipolar line extends). Note that the direction of the straight line connecting the target pixel and the epipole coincides with the direction in which the pixels in the image are arranged by the parallel processing (the u-axis direction on the reference image G1a).

ウィンドウサイズ設定部32は、図5に示すように、基準画像G1a上の相関ウィンドウのサイズを設定する対象画素u0について、対象画素u0に設定された相関ウィンドウのu軸方向に含まれる画素の輝度の最大値と最小値との差分値が、所定輝度間隔K0を超えるように、相関ウィンドウのサイズWを設定するものである。ここで、ウィンドウサイズ設定部32は、実際には基準画像の左端の画素から順に、相関ウィンドウのサイズを設定する。処理の詳細については後述する。   As shown in FIG. 5, the window size setting unit 32 sets the luminance of the pixels included in the u-axis direction of the correlation window set as the target pixel u0 for the target pixel u0 for setting the size of the correlation window on the reference image G1a. The size W of the correlation window is set so that the difference value between the maximum value and the minimum value exceeds the predetermined luminance interval K0. Here, the window size setting unit 32 actually sets the size of the correlation window sequentially from the leftmost pixel of the reference image. Details of the processing will be described later.

なお、相関ウィンドウのサイズを定めるための所定輝度間隔については、あらかじめ定められた値を用いてもよいが、基準画像G1aの輝度のばらつきに応じて算出するようにしてもよい。ここで、理想的な感度分布補正が行われた場合、輝度変化のない画像の輝度のプロファイルは図6の破線に示すものとなるが、実際には撮像部21A,21Bの感度のばらつきにより、図6の実線に示すように輝度にばらつきが生じるものとなる。この輝度のばらつきを正規分布と見なした場合の標準偏差をσ1とする。   Note that a predetermined value may be used as the predetermined luminance interval for determining the size of the correlation window, but it may be calculated according to the luminance variation of the reference image G1a. Here, when the ideal sensitivity distribution correction is performed, the luminance profile of the image without the luminance change is as shown by the broken line in FIG. 6, but in reality, due to the variation in sensitivity of the imaging units 21A and 21B, As shown by the solid line in FIG. 6, the luminance varies. The standard deviation when this luminance variation is regarded as a normal distribution is σ1.

一方、同一被写体を複数回撮影した場合、すべての画像の画素値が同一となるわけではなく、撮影毎に画素値のばらつき(繰り返しばらつき)が生じる。このばらつきを正規分布と見なした場合の標準偏差をσ2とする。   On the other hand, when the same subject is photographed a plurality of times, the pixel values of all the images are not the same, and pixel value variation (repetitive variation) occurs every time the image is photographed. The standard deviation when this variation is regarded as a normal distribution is σ2.

感度分布を補正した後の基準画像G1aの各画素の画素値は、撮像部21A,21Bの感度のばらつきおよび繰り返しばらつきを原因とするばらつきを有する。このばらつきの標準偏差σ0は、σ0=√(σ12+σ22)により算出される。ウィンドウサイズ設定部32は、標準偏差σ0の3σ(=3×σ0)を相関ウィンドウのサイズを定めるための所定輝度間隔として使用する。 The pixel value of each pixel of the reference image G1a after correcting the sensitivity distribution has variations due to sensitivity variations and repeated variations of the imaging units 21A and 21B. The standard deviation σ0 of this variation is calculated by σ0 = √ (σ1 2 + σ2 2 ). The window size setting unit 32 uses 3σ (= 3 × σ0) of the standard deviation σ0 as a predetermined luminance interval for determining the size of the correlation window.

CPU33は、レリーズボタンを含む入力部34からの信号に応じて立体撮像装置1の各部を制御する。   The CPU 33 controls each unit of the stereoscopic imaging apparatus 1 according to a signal from the input unit 34 including a release button.

データバス35は、立体撮像装置1を構成する各部およびCPU33に接続されており、立体撮像装置1における各種データおよび各種情報のやり取りを行う。   The data bus 35 is connected to each unit constituting the stereoscopic imaging device 1 and the CPU 33, and exchanges various data and various information in the stereoscopic imaging device 1.

次いで、第1の実施形態において行われる処理について説明する。図7は第1の実施形態において行われる処理を示すフローチャートである。なお、ここではレリーズボタンが全押しされて撮像の指示が行われた以降の処理について説明する。   Next, processing performed in the first embodiment will be described. FIG. 7 is a flowchart showing processing performed in the first embodiment. Here, processing after the release button is fully pressed and an instruction for imaging is performed will be described.

レリーズボタン4が全押しされることによりCPU33が処理を開始し、撮像部21A,21BがCPU33からの指示により被写体を撮像し、さらに取得した画像データに画像処理部23が、補正処理、並行化処理および画像処理を施して基準画像G1a,G1bおよび参照画像G2a,G2bを取得する(ステップST1)。次いで、ウィンドウサイズ設定部32が、並行化処理後の基準画像G1aの各画素について相関ウィンドウのサイズを設定する(ステップST2)。   When the release button 4 is fully pressed, the CPU 33 starts processing, the imaging units 21A and 21B capture the subject in accordance with an instruction from the CPU 33, and the image processing unit 23 performs correction processing and parallelization on the acquired image data. Processing and image processing are performed to obtain standard images G1a and G1b and reference images G2a and G2b (step ST1). Next, the window size setting unit 32 sets the size of the correlation window for each pixel of the reference image G1a after the parallelization processing (step ST2).

図8は第1の実施形態における相関ウィンドウのサイズの設定処理のフローチャートである。ウィンドウサイズ設定部32は、まずウィンドウサイズを設定する対象画素を初期位置に設定する(ステップST11)。なお、初期位置は基準画像G1aの左上隅の画素とする。そして、ウィンドウサイズ設定部32は、相関ウィンドウのサイズを探索するための探索画素列の画素数Nを初期値の3に設定する(ステップST12)。この場合、探索画素列の半値幅は1となる。次いで、探索画素列が基準画像G1a内にあるか否かを判定する(ステップST13)。ステップST13が否定されると、相関ウィンドウのサイズを適切に設定することができないことから、対象画素の相関ウィンドウのサイズをなしに設定し(ステップST14)、後述するステップST19の処理に進む。ここで、相関ウィンドウのサイズをなしに設定するとは、対象画素について相関ウィンドウのサイズを設定せず、対応点を探索しないことを意味する。   FIG. 8 is a flowchart of correlation window size setting processing in the first embodiment. The window size setting unit 32 first sets the target pixel for setting the window size at the initial position (step ST11). Note that the initial position is a pixel at the upper left corner of the reference image G1a. Then, the window size setting unit 32 sets the number of pixels N of the search pixel sequence for searching for the size of the correlation window to an initial value of 3 (step ST12). In this case, the half width of the search pixel column is 1. Next, it is determined whether or not the search pixel row is in the reference image G1a (step ST13). If step ST13 is negative, the size of the correlation window cannot be set appropriately, so the size of the correlation window of the target pixel is set to none (step ST14), and the process proceeds to step ST19 described later. Here, setting the size of the correlation window to none means that the size of the correlation window is not set for the target pixel and the corresponding point is not searched.

一方、ステップST13が肯定されると、探索画素列内の画素における輝度値の最大値と最小値との差分値を算出し(ステップST15)、差分値が所定輝度間隔K0を超えるか否かを判定する(ステップST16)。ステップST16が否定されると探索画素列画素数Nに2を加算し(N=N+2;ステップST17)、ステップST13に戻り、ステップST13以降の処理を繰り返す。これにより、ステップST16が肯定されるまで、図9に示すように探索画素列の画素数Nが3,5,7…と2ずつ増加する。なお、半値幅は1ずつ増加することとなる。   On the other hand, when step ST13 is affirmed, a difference value between the maximum value and the minimum value of the luminance values in the pixels in the search pixel row is calculated (step ST15), and whether or not the difference value exceeds the predetermined luminance interval K0. Determination is made (step ST16). If step ST16 is negative, 2 is added to the search pixel column pixel number N (N = N + 2; step ST17), the process returns to step ST13, and the processes in and after step ST13 are repeated. Thereby, as shown in FIG. 9, the number N of pixels in the search pixel column is increased by 2 as 3, 5, 7... Until step ST16 is affirmed. Note that the half width increases by one.

ステップST16が肯定されると、対象画素の相関ウィンドウのサイズWを現在の探索画素列の画素数Nに設定する(ステップST18)。ここで、図9に示すようにN=11のときに探索画素列内の画素の輝度の最大値と最小値との差分値が所定輝度間隔K0を超えた場合、相関ウィンドウのサイズWは11に設定される。   If step ST16 is positive, the size W of the correlation window of the target pixel is set to the number N of pixels of the current search pixel column (step ST18). Here, as shown in FIG. 9, when the difference value between the maximum value and the minimum value of the luminance of the pixels in the search pixel column exceeds N5, the correlation window size W is 11 when N = 11. Set to

次いで、ウィンドウサイズ設定部32は、対象画素が基準画像G1aの右端の画素であるか否かを判定し(ステップST19)、ステップST19が否定されると、対象画素を1画素右の画素に変更し(ステップST20)、ステップST12に戻り、ステップST12以降の処理を繰り返す。   Next, the window size setting unit 32 determines whether or not the target pixel is the rightmost pixel of the reference image G1a (step ST19). If step ST19 is negative, the target pixel is changed to the right pixel by one pixel. (Step ST20), the process returns to Step ST12, and the processes after Step ST12 are repeated.

ステップST19が肯定されると、対象画素が基準画像G1aの最下行にあるか否かを判定する(ステップST21)。ステップST21が否定されると、対象画素を1ライン下のラインにおける左端の画素に設定し(ステップST22)、ステップST12に戻り、ステップST12以降の処理を繰り返す。ステップST21が肯定されると処理を終了する。   If step ST19 is positive, it is determined whether or not the target pixel is in the bottom row of the reference image G1a (step ST21). If step ST21 is negative, the target pixel is set to the leftmost pixel in the line one line below (step ST22), the process returns to step ST12, and the processes after step ST12 are repeated. If step ST21 is affirmed, the process ends.

図7に戻り、ステップST2に続いて、ステレオマッチング部30が、設定したサイズの相関ウィンドウに基づいて対応点を探索し(ステップST3)、距離画像生成部31が、探索した対応点に基づいて距離画像D1を生成する(ステップST4)。次いで、CPU33からの指示によりメディア制御部26が距離画像D1を記録メディア29に記録し(画像記録:ステップST5)、処理を終了する。   Returning to FIG. 7, following step ST <b> 2, the stereo matching unit 30 searches for a corresponding point based on the correlation window having the set size (step ST <b> 3), and the distance image generating unit 31 searches based on the searched corresponding point. A distance image D1 is generated (step ST4). Next, in response to an instruction from the CPU 33, the media control unit 26 records the distance image D1 on the recording medium 29 (image recording: step ST5), and ends the process.

このように、第1の実施形態によれば、基準画像G1a上のエピポーラ線が延在する方向に対応するu軸方向において、輝度変化が小さい画素ほど大きいサイズの相関ウィンドウが設定されるため、基準画像G1aの輝度の変化量に応じた適切なサイズの相関ウィンドウを設定することができる。また、相関ウィンドウ内の各画素の輝度が必ず所定輝度間隔を有するものとなる。したがって、簡易な演算により相関ウィンドウのサイズを適切に設定することができるとともに、対応点探索の精度を向上させることができる。   As described above, according to the first embodiment, in the u-axis direction corresponding to the direction in which the epipolar line on the reference image G1a extends, a correlation window having a larger size is set for a pixel having a smaller luminance change. It is possible to set a correlation window of an appropriate size according to the amount of change in luminance of the reference image G1a. In addition, the luminance of each pixel in the correlation window always has a predetermined luminance interval. Accordingly, the size of the correlation window can be appropriately set by simple calculation, and the accuracy of the corresponding point search can be improved.

また、エピポーラ線が延在する方向に対応する方向の輝度変化に応じて相関ウィンドウのサイズを設定しているため、参照画像G2aにおける対応点を探索する方向における輝度の変化を反映させて相関ウィンドウのサイズを設定することができ、その結果、対応点探索の精度をより向上させることができる。   Further, since the size of the correlation window is set according to the luminance change in the direction corresponding to the direction in which the epipolar line extends, the correlation window reflects the luminance change in the direction in which the corresponding point in the reference image G2a is searched. As a result, the accuracy of the corresponding point search can be further improved.

次いで、本発明の第2の実施形態について説明する。なお、本発明の第2の実施形態による立体撮像装置は、本発明の第1の実施形態による立体撮像装置1と同一の構成を有し、ステレオマッチング部30およびウィンドウサイズ設定部32が行う処理のみが異なるため、ここでは構成についての詳細な説明は省略する。   Next, a second embodiment of the present invention will be described. Note that the stereoscopic imaging apparatus according to the second embodiment of the present invention has the same configuration as the stereoscopic imaging apparatus 1 according to the first embodiment of the present invention, and the processing performed by the stereo matching unit 30 and the window size setting unit 32 Since only the difference is made, detailed description of the configuration is omitted here.

図10は第2の実施形態において行われる処理を示すフローチャートである。レリーズボタン4が全押しされることによりCPU33が処理を開始し、撮像部21A,21BがCPU33からの指示により被写体を撮像し、さらに取得した画像データに画像処理部23が、補正処理、並行化処理および画像処理を施して基準画像G1a,G1bおよび参照画像G2a,G2bを取得する(ステップST31)。次いで、ウィンドウサイズ設定部32が、並行化処理後の基準画像G1aの各画素について相関ウィンドウのサイズを設定する(ステップST32)。なお、相関ウィンドウのサイズの設定の処理は上記第1の実施形態と同一であるため、ここでは詳細な説明は省略する。   FIG. 10 is a flowchart showing processing performed in the second embodiment. When the release button 4 is fully pressed, the CPU 33 starts processing, the imaging units 21A and 21B capture the subject in accordance with an instruction from the CPU 33, and the image processing unit 23 performs correction processing and parallelization on the acquired image data. Processing and image processing are performed to obtain standard images G1a and G1b and reference images G2a and G2b (step ST31). Next, the window size setting unit 32 sets the size of the correlation window for each pixel of the reference image G1a after the parallelization processing (step ST32). Note that the processing for setting the size of the correlation window is the same as that in the first embodiment, and a detailed description thereof will be omitted here.

次いで、ステレオマッチング部30が、内部メモリ27に記憶された相関ウィンドウのサイズリストを取り込む(ステップST33)。図11は相関ウィンドウのサイズリストを示す図である。図11に示すサイズリストT0は、実際に算出された相関ウィンドウのサイズと対応点探索に使用する相関ウィンドウのサイズとを対応づけたものであり、算出された相関ウィンドウのサイズを10または11画素単位で複数のサイズ群に分類し、使用する相関ウィンドウのサイズが、各サイズ群における最大サイズとなるように作成されている。すなわち、サイズリストT0は、算出された相関ウィンドウのサイズが1〜11画素の場合、使用する相関ウィンドウのサイズが11画素に、算出された相関ウィンドウのサイズが12〜21画素の場合、使用する相関ウィンドウのサイズが21画素となるように作成されている。    Next, the stereo matching unit 30 takes in the correlation window size list stored in the internal memory 27 (step ST33). FIG. 11 shows a correlation window size list. The size list T0 shown in FIG. 11 is obtained by associating the actually calculated size of the correlation window with the size of the correlation window used for the corresponding point search. The size of the calculated correlation window is 10 or 11 pixels. The unit is classified into a plurality of size groups, and the size of the correlation window to be used is created to be the maximum size in each size group. That is, the size list T0 is used when the calculated correlation window size is 1 to 11 pixels, and when the calculated correlation window size is 11 pixels and the calculated correlation window size is 12 to 21 pixels. The correlation window is created to have a size of 21 pixels.

ステレオマッチング部30は、サイズリストT0における最小となる相関ウィンドウのサイズ(対応点探索に使用するもの)を現在の相関ウィンドウのサイズに設定し(現在の相関ウィンドウのサイズ設定;ステップST34)、基準画像G1aにおいて現在の相関ウィンドウのサイズに対応するサイズ範囲の相関ウィンドウが設定された画素を、対応点探索対象の画素として抽出する(ステップST35)。そして、ステレオマッチング部30は、抽出された画素について、ステップST34において設定されたサイズの相関ウィンドウを用いて対応点を探索する(ステップST36)。   The stereo matching unit 30 sets the minimum correlation window size (used for the corresponding point search) in the size list T0 as the current correlation window size (current correlation window size setting; step ST34), and the reference In the image G1a, a pixel in which a correlation window in a size range corresponding to the current correlation window size is set is extracted as a corresponding point search target pixel (step ST35). Then, the stereo matching unit 30 searches for the corresponding points for the extracted pixels using the correlation window having the size set in step ST34 (step ST36).

ここで、ステレオマッチング部30は、参照画像G2aにおける相関が最大となる相関ウィンドウの中心画素を対応点として探索するが、対応点を探索したときの相関の最大値がそれほど大きくない場合、その相関に基づいて探索した対応点は、基準画像G1aの対象画素に対応するか否かが疑わしいものである。また、このような対応点を用いた場合、精度よく距離画像D1を算出することができないおそれがある。   Here, the stereo matching unit 30 searches for the center pixel of the correlation window that maximizes the correlation in the reference image G2a as a corresponding point. If the maximum value of the correlation when the corresponding point is searched is not so large, the correlation is calculated. It is doubtful whether the corresponding point searched based on the above corresponds to the target pixel of the reference image G1a. Further, when such corresponding points are used, there is a possibility that the distance image D1 cannot be calculated with high accuracy.

このため、ステレオマッチング部30は、相関が所定のしきい値Th1以下となるか否かを判定することにより、探索した対応点が誤対応点であるか否かの正誤判定を行う(ステップST37)。そして、誤対応と判定された基準画像G1a上の画素を抽出し(誤対応の画素抽出;ステップST38)、さらに、相関ウィンドウのサイズリストT0の「使用する相関ウィンドウのサイズ」に、現在の相関ウィンドウのサイズよりも大きいサイズがあるか否かを判定する(ステップST39)。   For this reason, the stereo matching unit 30 determines whether or not the searched corresponding point is an incorrect corresponding point by determining whether or not the correlation is equal to or less than a predetermined threshold value Th1 (step ST37). ). Then, a pixel on the reference image G1a determined to be miscorresponding is extracted (extracting miscorresponding pixel; step ST38), and the current correlation is added to the “size of correlation window to be used” in the correlation window size list T0. It is determined whether there is a size larger than the size of the window (step ST39).

ステップST39が肯定されると、現在の相関ウィンドウのサイズを1つ前の相関ウィンドウのサイズとして記憶するとともに、現在の相関ウィンドウのサイズを、相関ウィンドウのサイズリストT0における次に大きいサイズに設定する(相関ウィンドウのサイズ再設定:ステップST40)。そして、ステレオマッチング部30は、基準画像G1aにおいて現在の相関ウィンドウのサイズに対応するサイズ範囲の相関ウィンドウが設定された画素、およびステップST37の処理において誤対応と判定された画素を、対応点の探索対象の画素として抽出する(探索対象画素再抽出;ステップST41)。そして、ステップST36に戻り、ステップST36以降の処理を繰り返す。   If step ST39 is affirmed, the size of the current correlation window is stored as the size of the previous correlation window, and the size of the current correlation window is set to the next larger size in the correlation window size list T0. (Reset correlation window size: step ST40). Then, the stereo matching unit 30 converts the pixels for which the correlation window in the size range corresponding to the current correlation window size in the reference image G1a and the pixels determined to be incompatible in the process of step ST37 to the corresponding points. Extracted as search target pixels (search target pixel re-extraction; step ST41). And it returns to step ST36 and repeats the process after step ST36.

これにより、誤対応と判定された画素は、次に大きいサイズの相関ウィンドウが設定された画素に対する対応点探索の処理に含められることとなる。   As a result, the pixels determined to be inaccurate are included in the corresponding point search processing for the pixels for which the next largest correlation window is set.

一方、ステップST39が否定された場合には、距離画像生成部31が、それまでに探索された対応点(誤対応点を除く)に基づいて距離画像D1を生成する(ステップST42)。そして、CPU33からの指示によりメディア制御部26が基準画像G1a、参照画像G2aおよび距離画像D1を記録メディア29に記録し(画像記録:ステップST43)、処理を終了する。   On the other hand, if step ST39 is negative, the distance image generation unit 31 generates a distance image D1 based on the corresponding points searched so far (excluding incorrect corresponding points) (step ST42). Then, in response to an instruction from the CPU 33, the media control unit 26 records the standard image G1a, the reference image G2a, and the distance image D1 on the recording medium 29 (image recording: step ST43), and ends the process.

このように、同一サイズの相関ウィンドウ毎に対応点を探索することにより、効率よく対応点を探索することができる。   Thus, by searching for corresponding points for each correlation window of the same size, it is possible to search for corresponding points efficiently.

また、誤対応と判定された画素については、相関ウィンドウのサイズを大きくして再度の対応点の探索を行っているため、誤対応となる画素についてのみ単独で対応点の探索を行う必要がなくなり、その結果、誤対応となる画素について、効率よく対応点を探索できるとともに、対応点探索の精度を向上させることができる。   For pixels determined to be miscorresponding, the correlation window size is increased and the corresponding points are searched again, so that it is not necessary to search for corresponding points only for pixels that are miscorresponding. As a result, it is possible to efficiently search for corresponding points for pixels that are erroneously matched, and to improve the accuracy of the corresponding point search.

なお、第2の実施形態においては、相関が所定のしきい値Th1以下となる画素を誤対応となる画素と判定しているが、対応する画素が並んでいる順序が基準画像G1aおよび参照画像G2a上において逆になっている画素、基準画像G1a上において、参照画像G2aの複数の画素に対応している画素、および視差が局所的にその周囲と大きく変動している画素を誤対応となる画素として用いるようにしてもよい。   Note that in the second embodiment, pixels whose correlation is equal to or less than the predetermined threshold Th1 are determined to be erroneously associated with each other, but the order in which the corresponding pixels are arranged is the reference image G1a and the reference image. A pixel that is reversed on G2a, a pixel that corresponds to a plurality of pixels of the reference image G2a on the base image G1a, and a pixel whose parallax is greatly fluctuating locally with respect to its surroundings are erroneously associated. It may be used as a pixel.

なお、上記第1および第2の実施形態においては、撮像部21A,21Bを備えた立体撮像装置1に本発明を適用しているが、本発明による距離測定装置をカメラと別体で設けてもよい。   In the first and second embodiments, the present invention is applied to the stereoscopic imaging device 1 including the imaging units 21A and 21B. However, the distance measuring device according to the present invention is provided separately from the camera. Also good.

また、上記第1および第2の実施形態においては、距離画像D1のみを記録メディア29に記録しているが、基準画像G1bを距離画像D1とともに記録してもよく、基準画像G1bおよび参照画像G2bを距離画像D1とともに記録してもよい。また、基準画像G1aまたは基準画像G1aおよび参照画像G2aを距離画像D1とともに記録してもよく、さらには画像処理部23における処理前の基準画像G1または基準画像G1および参照画像G2を記録するようにしてもよい。   In the first and second embodiments, only the distance image D1 is recorded on the recording medium 29. However, the standard image G1b may be recorded together with the distance image D1, and the standard image G1b and the reference image G2b are recorded. May be recorded together with the distance image D1. Further, the standard image G1a or the standard image G1a and the reference image G2a may be recorded together with the distance image D1, and further, the standard image G1 or the standard image G1 and the reference image G2 before processing in the image processing unit 23 are recorded. May be.

また、上記第1および第2の実施形態においては、参照画像G2を取得するための撮像部を1つのみ設けているが、複数設けるようにし、複数の参照画像を取得して距離画像D1を生成するようにしてもよい。   In the first and second embodiments, only one imaging unit for acquiring the reference image G2 is provided. However, a plurality of reference images are acquired and the distance image D1 is obtained by acquiring a plurality of reference images. You may make it produce | generate.

また、上記第1および第2の実施形態においては、輝度に関係なく所定輝度間隔K0を一定値としているが、一般的には輝度が大きいほど図12(a)に示すように輝度のばらつきが大きくなる。ここで、輝度と輝度のばらつきとの関係は、例えば図12(b)に示すように輝度の平方根に比例することとなる。したがって、輝度毎に輝度のばらつきを求め、輝度毎に異なる輝度間隔を設定するようにしてもよい。この場合、輝度が大きいほど、所定輝度間隔K0は、図12(c)に示すように輝度の平方根に比例して大きくなる。   In the first and second embodiments, the predetermined luminance interval K0 is set to a constant value regardless of the luminance. Generally, as the luminance increases, the luminance variation increases as shown in FIG. growing. Here, the relationship between the luminance and the luminance variation is proportional to the square root of the luminance as shown in FIG. Therefore, the luminance variation may be obtained for each luminance, and a different luminance interval may be set for each luminance. In this case, as the luminance increases, the predetermined luminance interval K0 increases in proportion to the square root of the luminance as shown in FIG.

このように所定輝度間隔K0を変更することにより、光ショットノイズのように高い輝度において変動レベルが異なるばらつきの影響を相関ウィンドウのサイズの設定の処理から除去することができるため、より精度よく対応点を探索することができる。   By changing the predetermined luminance interval K0 in this way, it is possible to eliminate the influence of variations having different fluctuation levels at high luminance, such as light shot noise, from the processing for setting the size of the correlation window. You can search for points.

また、上記第1の実施形態においては、対応点を探索する際に、第2の実施形態と同様に対応点が誤対応であるか否かを判定し、誤対応であると判定された場合には、相関ウィンドウのサイズを設定されたサイズよりも大きくして、再度の対応点の探索を行うようにしてもよい。   In the first embodiment, when searching for corresponding points, it is determined whether the corresponding points are miscorresponding as in the second embodiment, and it is determined that they are miscorresponding. Alternatively, the correlation window size may be made larger than the set size, and the corresponding points may be searched again.

以上、本発明の実施形態について説明したが、コンピュータを、上記のステレオマッチング部30、距離画像生成部31およびウィンドウサイズ設定部32に対応する手段として機能させ、図7,8,10に示すような処理を行わせるプログラムも、本発明の実施形態の1つである。また、そのようなプログラムを記録したコンピュータ読取り可能な記録媒体も、本発明の実施形態の1つである。   As described above, the embodiment of the present invention has been described. As shown in FIGS. 7, 8, and 10, the computer functions as means corresponding to the stereo matching unit 30, the distance image generation unit 31, and the window size setting unit 32. A program for performing a simple process is also one embodiment of the present invention. A computer-readable recording medium in which such a program is recorded is also one embodiment of the present invention.

本発明の第1の実施形態による距離測定装置を適用した立体撮像装置の内部構成を示す概略ブロック図1 is a schematic block diagram showing an internal configuration of a stereoscopic imaging device to which a distance measuring device according to a first embodiment of the present invention is applied. 撮像部の構成を示す図Diagram showing the configuration of the imaging unit ステレオマッチングを説明するための図Diagram for explaining stereo matching 並行化処理後の基準画像および参照画像の位置関係を説明するための図The figure for demonstrating the positional relationship of the reference | standard image after a parallelization process, and a reference image 基準画像におけるu軸方向の輝度のプロファイルを示す図The figure which shows the profile of the brightness | luminance of the u-axis direction in a reference | standard image 輝度変化のない画像の輝度のプロファイルを示す図Diagram showing the luminance profile of an image with no luminance change 第1の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 1st Embodiment. 第1の実施形態における相関ウィンドウのサイズの設定処理のフローチャートFlowchart of correlation window size setting processing in the first embodiment 第1の実施形態における相関ウィンドウのサイズの設定処理を説明するための図The figure for demonstrating the setting process of the size of the correlation window in 1st Embodiment 第2の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 2nd Embodiment. 相関ウィンドウのサイズリストを示す図Figure showing the correlation window size list 基準輝度レベルの間隔の変更を説明するための図The figure for demonstrating the change of the space | interval of a reference | standard brightness level

符号の説明Explanation of symbols

1 立体撮像装置
21A,21B 撮像部
30 ステレオマッチング部
31 距離測定部
32 ウィンドウサイズ設定部
DESCRIPTION OF SYMBOLS 1 Stereo imaging device 21A, 21B Image pick-up part 30 Stereo matching part 31 Distance measurement part 32 Window size setting part

Claims (12)

被写体を撮像することにより取得された、該被写体上の着目点までの距離を算出するための基準画像、および該基準画像を取得した位置とは異なる位置から前記被写体を撮像することにより取得された、前記距離を算出するための少なくとも1つの参照画像の入力を受け付ける入力手段と、
前記基準画像上の着目点が投影された対象点について、該基準画像上の所定方向に延在する、該対象点を中心とする探索画素列であって、該探索画素列内の画素における輝度値の最大値と最小値との差分値が所定輝度間隔を超える探索画素列を設定し、該探索画素列の画素数を、前記対象点に対する前記参照画像上の対応点を探索する際に使用される、前記基準画像および前記参照画像の相関を算出する基準となる相関ウィンドウのサイズに設定するウィンドウサイズ設定手段と、
前記基準画像上に設定された相関ウィンドウ内の各画素と、前記参照画像上に設定された相関ウィンドウ内の各画素との相関を算出することにより、前記対応点を探索する対応点探索手段と、
該探索した対応点に基づいて前記距離を算出する距離算出手段とを備えたことを特徴とする距離測定装置。
A reference image for calculating the distance to the point of interest on the subject acquired by imaging the subject, and acquired by imaging the subject from a position different from the position from which the reference image was acquired. Input means for receiving input of at least one reference image for calculating the distance;
A target pixel point on the reference image on which the point of interest is projected, and a search pixel array centered on the target point and extending in a predetermined direction on the reference image, and the luminance of the pixels in the search pixel array A search pixel sequence in which a difference value between a maximum value and a minimum value exceeds a predetermined luminance interval is used, and the number of pixels in the search pixel sequence is used when searching for a corresponding point on the reference image with respect to the target point A window size setting means for setting a correlation window size as a reference for calculating a correlation between the reference image and the reference image;
Corresponding point search means for searching for the corresponding point by calculating a correlation between each pixel in the correlation window set on the reference image and each pixel in the correlation window set on the reference image; ,
A distance measuring device comprising distance calculating means for calculating the distance based on the searched corresponding point.
前記ウィンドウサイズ設定手段は、初期サイズの前記探索画素列を設定し、該探索画素列内の画素における輝度値の最大値と最小値との差分値を算出し、該差分値が前記所定輝度間隔を超えるか否かを判定し、該判定が否定された場合は前記探索画素列を前記所定方向にあらかじめ定められた画素数分大きくし、前記差分値が前記所定輝度間隔を超えるまで、前記探索画素列を大きくする処理を繰り返す手段であることを特徴とする請求項1記載の距離測定装置。   The window size setting means sets the search pixel sequence having an initial size, calculates a difference value between a maximum value and a minimum value of luminance values in pixels in the search pixel sequence, and the difference value is the predetermined luminance interval. If the determination is negative, the search pixel string is increased by a predetermined number of pixels in the predetermined direction, and the search is continued until the difference value exceeds the predetermined luminance interval. The distance measuring apparatus according to claim 1, wherein the distance measuring device is a unit that repeats the process of enlarging the pixel column. 前記所定方向が、前記基準画像の各画素を前記参照画像に写像することにより得られるエピポーラ線が延在する方向に対応する方向であることを特徴とする請求項1または2記載の距離測定装置。   The distance measuring device according to claim 1, wherein the predetermined direction is a direction corresponding to a direction in which an epipolar line obtained by mapping each pixel of the base image to the reference image extends. . 前記ウィンドウサイズ設定手段は、前記基準画像における輝度のばらつきに応じて、前記所定輝度間隔を設定する手段であることを特徴とする請求項1から3のいずれか1項記載の距離測定装置。   The distance measuring apparatus according to claim 1, wherein the window size setting unit is a unit that sets the predetermined luminance interval according to a variation in luminance in the reference image. 前記ウィンドウサイズ設定手段は、前記対象点の輝度が低いほど前記所定輝度間隔を小さくするように設定する手段であることを特徴とする請求項1から4のいずれか1項記載の距離測定装置。   5. The distance measuring device according to claim 1, wherein the window size setting means is a means for setting the predetermined luminance interval to be smaller as the luminance of the target point is lower. 前記対応点探索手段は、前記探索された対応点が誤対応点であるか否かを判定し、誤対応点であると判定された画素については、前記相関ウィンドウのサイズを大きくして再度前記対応点の探索を行う手段であることを特徴とする請求項1から5のいずれか1項記載の距離測定装置。   The corresponding point searching means determines whether or not the searched corresponding point is an incorrect corresponding point, and for the pixel determined to be an incorrect corresponding point, the size of the correlation window is increased again and the pixel is determined again. 6. The distance measuring device according to claim 1, wherein the distance measuring device is a means for searching for corresponding points. 前記基準画像の全画素について前記距離を算出するよう前記ウィンドウサイズ設定手段、前記対応点探索手段および前記距離算出手段を制御する制御手段と、
前記基準画像の各画素の距離を画素値とする距離画像を生成する距離画像生成手段とを備えたことを特徴とする請求項1から6のいずれか1項記載の距離測定装置。
Control means for controlling the window size setting means, the corresponding point search means and the distance calculation means so as to calculate the distance for all pixels of the reference image;
The distance measuring device according to claim 1, further comprising a distance image generating unit configured to generate a distance image having a pixel value as a distance between pixels of the reference image.
前記対応点探索手段は、同一サイズの前記相関ウィンドウが設定された画素毎に、該相関ウィンドウのサイズが小さい順に、前記対応点をまとめて探索する手段であることを特徴とする請求項7記載の距離測定装置。   The said corresponding point search means is a means to search for the said corresponding point collectively for every pixel to which the said correlation window of the same size was set in order with the size of this correlation window being small. Distance measuring device. 前記対応点探索手段は、一のサイズの前記相関ウィンドウを用いて探索された対応点のうち、誤対応となる誤対応点が探索された前記基準画像の画素については、前記相関ウィンドウのサイズを一段階大きくし、該一段階大きいサイズの前記相関ウィンドウが設定された画素とともに前記対応点を探索する手段であることを特徴とする請求項8記載の距離測定装置。   The corresponding point search means sets the size of the correlation window for pixels of the reference image for which an incorrect corresponding point that has been erroneously matched among the corresponding points searched using the correlation window of one size is searched. 9. The distance measuring apparatus according to claim 8, wherein the distance measuring device is a means for searching for the corresponding point together with a pixel in which the correlation window having a size larger by one step is set. 前記ウィンドウサイズ設定手段は、前記相関ウィンドウのサイズを所定の複数のサイズ群に分類し、前記各画素の前記相関ウィンドウのサイズを、該各画素について設定した相関ウィンドウのサイズが分類された前記サイズ群における最大サイズに再設定する手段であることを特徴とする請求項7から9のいずれか1項記載の距離測定装置。   The window size setting means classifies the size of the correlation window into a plurality of predetermined size groups, and sets the size of the correlation window of each pixel to the size of the correlation window set for each pixel. 10. The distance measuring device according to claim 7, wherein the distance measuring device is a means for resetting the maximum size in the group. 被写体を撮像することにより取得された、該被写体上の着目点までの距離を算出するための基準画像、および該基準画像を取得した位置とは異なる位置から前記被写体を撮像することにより取得された、前記距離を算出するための少なくとも1つの参照画像の入力を受け付け、
前記基準画像上の着目点が投影された対象点について、該基準画像上の所定方向に延在する、該対象点を中心とする探索画素列であって、該探索画素列内の画素における輝度値の最大値と最小値との差分値が所定輝度間隔を超える探索画素列を設定し、該探索画素列の画素数を、前記対象点に対する前記参照画像上の対応点を探索する際に使用される、前記基準画像および前記参照画像の相関を算出する基準となる相関ウィンドウのサイズに設定し、
前記基準画像上に設定された相関ウィンドウ内の各画素と、前記参照画像上に設定された相関ウィンドウ内の各画素との相関を算出することにより、前記対応点を探索し、
該探索した対応点に基づいて前記距離を算出することを特徴とする距離測定方法。
A reference image for calculating the distance to the point of interest on the subject acquired by imaging the subject, and acquired by imaging the subject from a position different from the position from which the reference image was acquired. , Accepting input of at least one reference image for calculating the distance,
A target pixel point on the reference image on which the point of interest is projected, and a search pixel array centered on the target point and extending in a predetermined direction on the reference image, and the luminance of the pixels in the search pixel array A search pixel sequence in which a difference value between a maximum value and a minimum value exceeds a predetermined luminance interval is used, and the number of pixels in the search pixel sequence is used when searching for a corresponding point on the reference image with respect to the target point Is set to the size of a correlation window serving as a reference for calculating the correlation between the reference image and the reference image,
By searching for the corresponding points by calculating the correlation between each pixel in the correlation window set on the reference image and each pixel in the correlation window set on the reference image,
A distance measuring method, wherein the distance is calculated based on the searched corresponding points.
被写体を撮像することにより取得された、該被写体上の着目点までの距離を算出するための基準画像、および該基準画像を取得した位置とは異なる位置から前記被写体を撮像することにより取得された、前記距離を算出するための少なくとも1つの参照画像の入力を受け付ける手順と、
前記基準画像上の着目点が投影された対象点について、該基準画像上の所定方向に延在する、該対象点を中心とする探索画素列であって、該探索画素列内の画素における輝度値の最大値と最小値との差分値が所定輝度間隔を超える探索画素列を設定し、該探索画素列の画素数を、前記対象点に対する前記参照画像上の対応点を探索する際に使用される、前記基準画像および前記参照画像の相関を算出する基準となる相関ウィンドウのサイズに設定する手順と、
前記基準画像上に設定された相関ウィンドウ内の各画素と、前記参照画像上に設定された相関ウィンドウ内の各画素との相関を算出することにより、前記対応点を探索する手順と、
該探索した対応点に基づいて前記距離を算出する手順とを有することを特徴とする距離測定方法をコンピュータに実行させるためのプログラム。
A reference image for calculating the distance to the point of interest on the subject acquired by imaging the subject, and acquired by imaging the subject from a position different from the position from which the reference image was acquired. Receiving at least one reference image input for calculating the distance;
A target pixel point on the reference image on which the point of interest is projected, and a search pixel array centered on the target point and extending in a predetermined direction on the reference image, and the luminance of the pixels in the search pixel array A search pixel sequence in which a difference value between a maximum value and a minimum value exceeds a predetermined luminance interval is used, and the number of pixels in the search pixel sequence is used when searching for a corresponding point on the reference image with respect to the target point A procedure for setting a correlation window size as a reference for calculating a correlation between the reference image and the reference image;
A procedure for searching for the corresponding point by calculating a correlation between each pixel in the correlation window set on the reference image and each pixel in the correlation window set on the reference image;
A program for causing a computer to execute a distance measuring method, comprising: calculating the distance based on the searched corresponding points.
JP2008145397A 2008-06-03 2008-06-03 Distance measuring device, method and program Active JP5071866B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008145397A JP5071866B2 (en) 2008-06-03 2008-06-03 Distance measuring device, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008145397A JP5071866B2 (en) 2008-06-03 2008-06-03 Distance measuring device, method and program

Publications (2)

Publication Number Publication Date
JP2009293971A JP2009293971A (en) 2009-12-17
JP5071866B2 true JP5071866B2 (en) 2012-11-14

Family

ID=41542284

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008145397A Active JP5071866B2 (en) 2008-06-03 2008-06-03 Distance measuring device, method and program

Country Status (1)

Country Link
JP (1) JP5071866B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110169818A1 (en) * 2010-01-13 2011-07-14 Sharp Laboratories Of America, Inc. Reducing viewing discomfort
JP5849495B2 (en) * 2011-07-28 2016-01-27 富士電機株式会社 Axle detection device
US9741143B2 (en) * 2013-05-29 2017-08-22 Nec Corporation Multocular imaging system, synthesis process method of acquired images, and program
US11122180B2 (en) * 2014-05-02 2021-09-14 Dentsply Sirona Inc. Systems, methods, apparatuses, and computer-readable storage media for collecting color information about an object undergoing a 3D scan
CN115280096A (en) 2020-03-05 2022-11-01 发那科株式会社 Three-dimensional measurement device for generating positional information of object surface based on images captured by a plurality of cameras

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3291998B2 (en) * 1995-10-02 2002-06-17 富士電機株式会社 Distance measuring device
JPH1021403A (en) * 1996-07-05 1998-01-23 Canon Inc Method and device for extracting correspondent points
JP2000028354A (en) * 1998-07-13 2000-01-28 Victor Co Of Japan Ltd Three-dimensional image processing device
JP2006221603A (en) * 2004-08-09 2006-08-24 Toshiba Corp Three-dimensional-information reconstructing apparatus, method and program
JP2008090583A (en) * 2006-10-02 2008-04-17 Konica Minolta Holdings Inc Information processing system, program, and information processing method

Also Published As

Publication number Publication date
JP2009293971A (en) 2009-12-17

Similar Documents

Publication Publication Date Title
JP4886716B2 (en) Image processing apparatus and method, and program
JP6415179B2 (en) Image processing apparatus, image processing method, imaging apparatus, and control method thereof
CN107517346B (en) Photographing method and device based on structured light and mobile device
US8922627B2 (en) Image processing device, image processing method and imaging device
JP2012103109A (en) Stereo image processing device, stereo image processing method and program
US20150178595A1 (en) Image processing apparatus, imaging apparatus, image processing method and program
JP5071866B2 (en) Distance measuring device, method and program
JP7024736B2 (en) Image processing equipment, image processing method, and program
JPWO2011125937A1 (en) Calibration data selection device, selection method, selection program, and three-dimensional position measurement device
JPWO2014171418A1 (en) 3D shape measuring apparatus, 3D shape measuring method, and 3D shape measuring program
WO2012029658A1 (en) Imaging device, image-processing device, image-processing method, and image-processing program
JP5857712B2 (en) Stereo image generation apparatus, stereo image generation method, and computer program for stereo image generation
WO2012133371A1 (en) Image capture position and image capture direction estimation device, image capture device, image capture position and image capture direction estimation method and program
JP6409769B2 (en) 3D shape measuring apparatus, 3D shape measuring method, and 3D shape measuring program
JP6395429B2 (en) Image processing apparatus, control method thereof, and storage medium
JP5071865B2 (en) Distance measuring device, method and program
JP5925109B2 (en) Image processing apparatus, control method thereof, and control program
JP2008224323A (en) Stereoscopic photograph measuring instrument, stereoscopic photograph measuring method, and stereoscopic photograph measuring program
US10332259B2 (en) Image processing apparatus, image processing method, and program
JP7438713B2 (en) Imaging device, method and program
JP2013118472A (en) Image processing apparatus, imaging apparatus and image processing program
JP2009237652A (en) Image processing apparatus and method, and program
JP2016162034A (en) Three-dimensional model generation system, three-dimensional model generation apparatus, and three-dimensional model generation method
JP6292785B2 (en) Image processing apparatus, image processing method, and program
JP6827778B2 (en) Image processing equipment, image processing methods and programs

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110114

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20110114

RD15 Notification of revocation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7435

Effective date: 20110418

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120723

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120810

R150 Certificate of patent or registration of utility model

Ref document number: 5071866

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150831

Year of fee payment: 3

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250