JP2012198712A - Image processing system, image processing method and image processing program - Google Patents

Image processing system, image processing method and image processing program Download PDF

Info

Publication number
JP2012198712A
JP2012198712A JP2011061743A JP2011061743A JP2012198712A JP 2012198712 A JP2012198712 A JP 2012198712A JP 2011061743 A JP2011061743 A JP 2011061743A JP 2011061743 A JP2011061743 A JP 2011061743A JP 2012198712 A JP2012198712 A JP 2012198712A
Authority
JP
Japan
Prior art keywords
block
shape
reference image
image
setting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2011061743A
Other languages
Japanese (ja)
Other versions
JP5782766B2 (en
Inventor
Sadao Takahashi
禎郎 高橋
Takeshi Maruyama
剛 丸山
Shin Aoki
青木  伸
Kazunari Abe
一成 安部
Masahiro Fujimoto
真裕 藤本
Shigeru Ouchida
茂 大内田
Junichi Azumi
純一 安住
Jun Watabe
順 渡部
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2011061743A priority Critical patent/JP5782766B2/en
Publication of JP2012198712A publication Critical patent/JP2012198712A/en
Application granted granted Critical
Publication of JP5782766B2 publication Critical patent/JP5782766B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an image processing system estimating a corresponding point of a sub-pixel level with high accuracy.SOLUTION: The image processing system includes: block shape setting means for setting a bock shape for performing a matching block by using one of two images as a criterion image and the other as a reference image; criterion image block position setting means for setting a block position in the criterion image based on the block shape set by the block shape setting means; reference image block position setting means for setting a plurality of blocks in the vicinity of a position corresponding to the block position set by the criterion image block position setting means in the reference image; and an evaluation value arithmetic means for calculating a correlation evaluation value between the block set in the criterion image and the plurality of blocks set by the reference image block position setting means. The block shape setting means sets the block shape according to the shape of an object included in the criterion image.

Description

本発明は、画像処理装置、画像処理方法、及び画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program.

近年、例えばカメラにより撮影された画像から3次元形状を取得する方法として、ステレオカメラのように異なる視点から撮影した2つの画像を用いる方法が知られている。この方法では、2つの画像間において対応付けを行い、相互に対応する点から視差を求め、被写体までの距離情報を取得する。なお、対応点の探索方法としては、例えば一方の基準画像上の注目点に対して注目点を含むブロックを設定し、他方の参照画像上に同サイズのブロックを画素(ピクセル)単位で複数設定する。このように設定した基準画像上のブロックと、参照画像上の各ブロック間で相関値を算出し、最も相関値が高い参照画像上のブロックを探索することで対応点を探索する。   In recent years, for example, as a method for acquiring a three-dimensional shape from an image photographed by a camera, a method using two images photographed from different viewpoints like a stereo camera is known. In this method, two images are associated with each other, parallax is obtained from points corresponding to each other, and distance information to the subject is acquired. As a method for searching for corresponding points, for example, a block including a point of interest is set for a point of interest on one base image, and a plurality of blocks of the same size are set on the other reference image in units of pixels. To do. Correlation values are calculated between the block on the reference image set in this way and each block on the reference image, and the corresponding point is searched by searching for the block on the reference image having the highest correlation value.

ここで、3次元画像における距離分解能を上げるためには、視差の分解能を上げれば良い。視差の分解能を上げるためには、画素レベルよりも細かい精度で対応付けを行えば良い。そこで、例えばサブピクセルレベルでの画素の対応付けを行う。なお、サブピクセルレベルでの画素の対応付けは、例えば画素レベルで求めた相関値をサブピクセル推定モデルに当てはめる処理(フィッティング処理)を行うことで、サブピクセルレベルの対応点を推定する方法が用いられている。   Here, in order to increase the distance resolution in the three-dimensional image, the resolution of the parallax may be increased. In order to increase the resolution of the parallax, it is only necessary to perform the association with an accuracy finer than the pixel level. Therefore, for example, pixel association at the sub-pixel level is performed. Note that the pixel association at the sub-pixel level is performed by, for example, a method of estimating the corresponding point at the sub-pixel level by performing processing (fitting processing) for applying the correlation value obtained at the pixel level to the sub-pixel estimation model. It has been.

なお、従来では、サブピクセル精度で対応点を推定するため、最も相関値の高い位置とその周辺の相関値との位置関係から画素と画素との間の相関値を直線式又は曲線式に当てはめることによって補間し、相関値のピーク位置及びピーク値を推定する方法が知られている(例えば、特許文献1参照)。また、ピーク位置及びピーク位置の周辺における相関値とサブピクセル推定モデルとの合致度に基づいてサブピクセル推定モデルを選択する方法が知られている(例えば、特許文献2参照)。また、4点の相関値を用いてサブピクセルレベルの対応点を推定する折れ線と放物線の和をとったサブピクセル推定モデルの関数が知られている(例えば、非特許文献1参照)。   Conventionally, in order to estimate corresponding points with sub-pixel accuracy, the correlation value between pixels is applied to a linear equation or a curved equation based on the positional relationship between the position having the highest correlation value and the surrounding correlation values. There is known a method of interpolating and estimating a peak position and a peak value of a correlation value (for example, see Patent Document 1). A method of selecting a subpixel estimation model based on the peak position and the degree of coincidence between the correlation value around the peak position and the subpixel estimation model is known (see, for example, Patent Document 2). Also, a function of a subpixel estimation model that takes the sum of a polygonal line and a parabola to estimate corresponding points at the subpixel level using four correlation values is known (see, for example, Non-Patent Document 1).

更に、窓内の視差、雑音と画像の微分の分布を正規分布と仮定したMAP推定により視差の分散と平均値を求め、視差の分散を最小にする窓を、相関演算を行う窓と決定する方法が知られている(例えば、非特許文献2参照)。また、視差の不連続を反映した適応窓を設定することによって視差が不連続付近での分解能の向上を図る視差演算方法が知られている(例えば、特許文献3参照)。なお、サブピクセル視差の検出精度を高めるために、複数のステレオ画像から得られる相関値を加算する複眼撮像装置が知られている(例えば、特許文献4参照)   Furthermore, the variance and average value of parallax are obtained by MAP estimation assuming that the distribution of parallax, noise, and image differential in the window is a normal distribution, and the window that minimizes the parallax variance is determined as the window for performing the correlation operation. The method is known (for example, refer nonpatent literature 2). In addition, a parallax calculation method is known in which resolution is improved in the vicinity of disparity by setting an adaptive window reflecting discontinuity of disparity (see, for example, Patent Document 3). In addition, in order to improve the detection accuracy of subpixel parallax, a compound eye imaging device that adds correlation values obtained from a plurality of stereo images is known (see, for example, Patent Document 4).

ところで、上述したステレオカメラは、例えば2台のカメラを利用して構成するため、その形状が大きくなり、設置したい場所に設置することができない場合も生じる。そこで、例えばレンズアレイを用いて、1つの画像センサで複数の視点の画像を取得し、その複数の画像から距離情報を得る超小型のステレオカメラが研究されている。また、例えば2つの画像センサをシリコンウェハ上に隣接して形成し、その上にレンズアレイを搭載して各センサから視点の異なる画像を得ることも研究されている。   By the way, since the stereo camera described above is configured by using, for example, two cameras, the shape of the stereo camera becomes large, and there may be a case where the stereo camera cannot be installed at a desired location. Therefore, for example, an ultra-small stereo camera that uses a lens array to acquire images from a plurality of viewpoints with one image sensor and obtains distance information from the plurality of images has been studied. In addition, for example, it has been studied that two image sensors are formed adjacent to each other on a silicon wafer and a lens array is mounted thereon to obtain images with different viewpoints from the respective sensors.

一方、上述した超小型ステレオカメラは、従来のステレオカメラと異なり、その基線長(レンズ間の距離)が非常に小さい。例えばカメラ2台を用いた従来のステレオカメラの基線長が10cm前後の場合でも、超小型ステレオカメラでは、数mm程度である。ここで、ステレオカメラを用いた測距原理として基線長が小さい場合には、検出可能な視差も小さくなる。すなわち、所定の距離にある被写体を撮影したときに、例えば10cm程度の基線長を持つステレオカメラが検出できる視差が50画素程度とすると、例えば2mm程度の基線長を持つステレオカメラの場合、カメラの焦点距離が変わらないと仮定するとその検出できる視差は1画素程度となってしまう。これは、サブピクセルレベルの視差の距離測定精度に与える度合いが、前者のカメラの場合には1%程度であるのに対し、後者のカメラの場合にはほぼ100%となる。すなわち、基線長の小さい超小型ステレオカメラの場合、その距離測定精度がサブピクセルレベルの視差検出(対応点付け)精度に大きく依存することとなる。   On the other hand, unlike the conventional stereo camera, the ultra-small stereo camera described above has a very short base length (distance between lenses). For example, even when the base line length of a conventional stereo camera using two cameras is about 10 cm, it is about several millimeters with an ultra-small stereo camera. Here, when the baseline length is small as a distance measurement principle using a stereo camera, the detectable parallax is also small. That is, when a parallax that can be detected by a stereo camera having a base length of about 10 cm when a subject at a predetermined distance is photographed is about 50 pixels, for example, in the case of a stereo camera having a base length of about 2 mm, Assuming that the focal length does not change, the detectable parallax is about one pixel. The degree of the parallax distance measurement accuracy given to the sub-pixel level is about 1% in the case of the former camera, but is almost 100% in the case of the latter camera. That is, in the case of an ultra-small stereo camera with a small baseline length, the distance measurement accuracy greatly depends on the sub-pixel level parallax detection (corresponding point marking) accuracy.

したがって、上述したサブピクセルレベルの視差検出精度は、従来の大きさのステレオカメラでは問題とならなかったのに対し、超小型ステレオカメラでは重要な問題となってくる。ここで、図1及び図2を用いて、上述したサブピクセルレベルの視差検出精度が与える問題について説明する。   Therefore, the above-described sub-pixel level parallax detection accuracy is not a problem in a conventional stereo camera, but is an important problem in a miniature stereo camera. Here, the problem given by the sub-pixel level parallax detection accuracy described above will be described with reference to FIGS. 1 and 2.

図1は、所定距離にある物体を撮影した基準画像と参照画像を用いてブロックマッチングを行う方法を説明するための図である。また、図2は、基準画像のブロックに対して参照画像に設定したブロックが所定画素ずれている場合を説明するための図である。   FIG. 1 is a diagram for explaining a method of performing block matching using a standard image obtained by photographing an object at a predetermined distance and a reference image. FIG. 2 is a diagram for explaining a case where the block set as the reference image is shifted by a predetermined pixel with respect to the block of the base image.

上述した対応点を探索するためにブロック単位の相関値を求める方法は、ブロックマッチングといわれ、通常、そのブロック形状は正方形が使用されている。ブロック形状が正方形の場合、上下左右対称となるため、ソフトウェアやハードウェアの演算では扱いやすい。ところで、現実の世の中の物体形状を鑑みると、その形状は水平線と垂直線で構成されているものが多い。   The above-described method for obtaining a correlation value for each block in order to search for corresponding points is called block matching, and a square is usually used as the block shape. When the block shape is square, it is easy to handle software and hardware operations because it is vertically and horizontally symmetrical. By the way, in view of the actual object shape in the world, the shape is often composed of a horizontal line and a vertical line.

ここで、図1(A)を基準画像として、図1(B)を参照画像とした場合に、基準画像と参照画像には左右方向に1画素の視差があるものとする。図1(A)に示す基準画像に点Aを中心とした正方形のブロックを設定し、図1(B)に示す参照画像に同じ形状、同じ大きさのブロックを複数設定して対応点探索を行う。   Here, assuming that FIG. 1A is a reference image and FIG. 1B is a reference image, the reference image and the reference image have a one-pixel parallax in the left-right direction. A square block centered on point A is set in the reference image shown in FIG. 1A, and a plurality of blocks having the same shape and size are set in the reference image shown in FIG. Do.

図2(A)に示す基準画像のブロックに対して、相関値が最大となる参照画像のブロック位置は、図2(A')に示す参照画像の破線で囲まれたブロック位置である。すなわち、図2(A')に示す参照画像の点A'が、図2(A)に示す基準画像の点Aに最も近い画素単位の対応点である。   The block position of the reference image having the maximum correlation value with respect to the block of the standard image shown in FIG. 2A is a block position surrounded by a broken line of the reference image shown in FIG. That is, the point A ′ of the reference image shown in FIG. 2A ′ is a corresponding point in pixel units that is closest to the point A of the standard image shown in FIG.

上述した図2(A')に示す参照画像のブロックが1画素左にずれたときの参照画像のブロック位置は、図2(B')に示す参照画像のブロック位置となる。この場合、図2(B')に示す参照画像のブロックの左端部分は、図2(B)に示す基準画像のブロックの左端部分とは大きく異なる画素(画像)輝度値を有し、図2(B)及び図2(B')に示す中心付近の画素輝度値の差分に相当する相関の低下に加えて更に相関が小さくなる(例えば、SAD(Sum of Absolute Difference:各ブロックの対応する画素値の差分の絶対値和)やSSD(Sum of Squared Difference:各ブロックの対応する画素値の差分二乗和)の場合には評価値が大きくなる)。   The block position of the reference image when the block of the reference image shown in FIG. 2 (A ′) is shifted to the left by one pixel is the block position of the reference image shown in FIG. 2 (B ′). In this case, the left end portion of the block of the reference image shown in FIG. 2 (B ′) has a pixel (image) luminance value that is significantly different from the left end portion of the block of the standard image shown in FIG. 2 (B). In addition to the decrease in correlation corresponding to the difference in pixel luminance value near the center shown in (B) and FIG. 2 (B ′), the correlation further decreases (for example, SAD (Sum of Absolute Difference: corresponding pixel of each block) In the case of the sum of absolute values of the difference of values) or SSD (Sum of Squared Difference: the sum of squares of the difference of the pixel values corresponding to each block), the evaluation value becomes large).

一方、図2(C')のように、参照画像のブロック位置が図2(C)に示す基準画像のブロックと1画素右にずれたときの相関は、図2(C)及び図2(C')に示す基準画像と参照画像のブロック境界はその画素輝度値の差が大きく異なっていない。そのため、相関は中心付近の画素輝度値の差分に相当する値だけ小さくなる。   On the other hand, as shown in FIG. 2C ′, the correlation when the block position of the reference image is shifted to the right by one pixel from the block of the standard image shown in FIG. The difference between the pixel luminance values of the block boundaries between the standard image and the reference image shown in FIG. Therefore, the correlation is reduced by a value corresponding to the difference between the pixel luminance values near the center.

ここで、図3は、図2に示す基準画像のブロックと参照画像のブロックとの相関関係をグラフ上にプロットした図である。なお、図3(A)〜(C)は、二次曲線フィッティングを示している。   Here, FIG. 3 is a diagram in which the correlation between the block of the base image and the block of the reference image shown in FIG. 2 is plotted on a graph. 3A to 3C show quadratic curve fitting.

図3(A)は、横軸が探索画素位置を示し、縦軸はNCC(Normalize Cross Correlation:正規化相互相関法:各ブロックの対応画素値の積和を正規化する)評価値を示している。また、図3(B)は、横軸が探索画素位置を示し、縦軸がSAD評価値、SSD評価値を示している。また、図3(C)は、横軸が探索画素位置を示し、縦軸が相関値を示している。   In FIG. 3A, the horizontal axis represents the search pixel position, and the vertical axis represents the NCC (Normalize Cross Correlation: normalized cross-correlation method: normalizes the product sum of corresponding pixel values of each block) evaluation value. Yes. In FIG. 3B, the horizontal axis indicates the search pixel position, and the vertical axis indicates the SAD evaluation value and the SSD evaluation value. In FIG. 3C, the horizontal axis indicates the search pixel position, and the vertical axis indicates the correlation value.

図3(A)の場合は、相関が最大の時に評価値が最大となり、図3(B)の場合は、相関が最大の時にその評価値が最小となる。   In the case of FIG. 3A, the evaluation value becomes maximum when the correlation is maximum, and in the case of FIG. 3B, the evaluation value becomes minimum when the correlation is maximum.

上述したように図2に示す基準画像と参照画像とは、1画素の視差があるため、理想的にはその相関関係は、図3(C)に示す画素単位の対応点(すなわち図3(C)の例では探索画素位置1の点)を中心に対称となり、サブピクセルレベルで視差は発生しない。   As described above, since the standard image and the reference image shown in FIG. 2 have a one-pixel parallax, ideally, the correlation between the reference image and the reference image shown in FIG. In the example of C), the pixel is symmetric with respect to the point of the search pixel position 1), and no parallax occurs at the subpixel level.

これに対して、図3(A)及び図3(B)の図では、相関関係が最大となる場合の対応点を中心に左右対称とならず、サブピクセルレベルでの視差が発生している。すなわち、対応点探索のサブピクセルレベルの推定を行った場合には、二次曲線フィッティング又は等角直線フィッティングのいずれの方法をとってもサブピクセル値は「0」にならず、「0」以外の値を有することになる。   On the other hand, in the diagrams of FIGS. 3A and 3B, parallax is generated at the sub-pixel level without being symmetrical with respect to the corresponding point when the correlation is maximum. . That is, when sub-pixel level estimation is performed for the corresponding point search, the sub-pixel value does not become “0” by any method of quadratic curve fitting or equiangular straight line fitting, and a value other than “0”. Will have.

これは、対応点探索のサブピクセル推定を行ったときの検出誤差となり、上述した超小型ステレオカメラにとって大きな問題となる。   This is a detection error when subpixel estimation is performed for the corresponding point search, which is a big problem for the above-described ultra-small stereo camera.

なお、上述した特許文献1、特許文献2、及び非特許文献1に示される手法では,サブピクセル推定精度を向上させる方法が記載されているが、いずれの方式でも、上述した相関値を求める際の問題点については言及していない。また、上述した非特許文献2や特許文献3に示される手法では、対応点付けの精度を向上させるために、ブロックの形状やサイズを変更したりしているが、ブロックが矩形状であるため、ブロックの境界が被写体の境界と一致し、上述した相関関係に影響を及ぼす問題を解決していない。更に、特許文献4に示される手法でも同様にブロック形状は矩形状となっている。   Note that the methods disclosed in Patent Document 1, Patent Document 2, and Non-Patent Document 1 described above describe a method for improving subpixel estimation accuracy. However, in any method, the above-described correlation value is obtained. It does not mention the problems. In addition, in the methods described in Non-Patent Document 2 and Patent Document 3 described above, the shape and size of the block are changed in order to improve the accuracy of matching, but the block is rectangular. The problem that the boundary of the block coincides with the boundary of the subject and affects the above-described correlation is not solved. Further, in the method disclosed in Patent Document 4, the block shape is similarly rectangular.

本発明は、上記の課題に鑑みてなされたものであり、精度の高いサブピクセルレベルの対応点を推定する画像処理装置を提供することを目的とする。   The present invention has been made in view of the above problems, and an object of the present invention is to provide an image processing apparatus that estimates corresponding points at a subpixel level with high accuracy.

本発明は、上記目的を達成するための画像処理装置であり、2つの画像の一方を基準画像、他方を参照画像としてマッチングブロックを行うためのブロック形状を設定するブロック形状設定手段と、前記ブロック形状設定手段により設定されたブロック形状に基づいて、前記基準画像におけるブロック位置を設定する基準画像ブロック位置設定手段と、前記参照画像において、前記基準画像ブロック位置設定手段により設定されたブロック位置に対応する位置の近傍に複数のブロックを設定する参照画像ブロック位置設定手段と、前記基準画像内に設定されたブロックと、前記参照画像ブロック位置設定手段により設定された複数のブロックとの相関評価値を算出する評価値演算手段とを有し、前記ブロック形状設定手段は、前記基準画像の含まれる対象物の形状に応じて前記ブロック形状を設定することを特徴とする。   The present invention is an image processing apparatus for achieving the above object, a block shape setting means for setting a block shape for performing a matching block using one of two images as a standard image and the other as a reference image, and the block Corresponding to the reference image block position setting means for setting the block position in the reference image based on the block shape set by the shape setting means, and the block position set by the reference image block position setting means in the reference image Reference image block position setting means for setting a plurality of blocks in the vicinity of the position to be detected, a block set in the standard image, and a correlation evaluation value between the plurality of blocks set by the reference image block position setting means Evaluation value calculation means for calculating, and the block shape setting means And sets the block-shaped according to the shape of Murrell object.

また、本発明は、画像処理方法であり、2つの画像の一方を基準画像、他方を参照画像としてマッチングブロックを行うためのブロック形状を設定するブロック形状設定手順と、前記ブロック形状設定手順により設定されたブロック形状に基づいて、前記基準画像におけるブロック位置を設定する基準画像ブロック位置設定手順と、前記参照画像において、前記基準画像ブロック位置設定手順により設定されたブロック位置に対応する位置の近傍に複数のブロックを設定する参照画像ブロック位置設定手順と、前記基準画像内に設定されたブロックと、前記参照画像ブロック位置設定手順により設定された複数のブロックとの相関評価値を算出する評価値演算手順とを有し、前記ブロック形状設定手順は、前記基準画像の含まれる対象物の形状に応じて前記ブロック形状を設定することを特徴とする。   The present invention is also an image processing method, wherein a block shape setting procedure for setting a block shape for performing a matching block using one of two images as a standard image and the other as a reference image is set by the block shape setting procedure. A reference image block position setting procedure for setting a block position in the reference image based on the block shape, and a position near the position corresponding to the block position set by the reference image block position setting procedure in the reference image. Reference image block position setting procedure for setting a plurality of blocks, evaluation value calculation for calculating a correlation evaluation value between a block set in the base image and a plurality of blocks set by the reference image block position setting procedure The block shape setting procedure includes a shape of an object included in the reference image. And sets the block shape according to.

また、本発明は、コンピュータを、上述した画像処理装置として機能させるための画像処理プログラムである。   Further, the present invention is an image processing program for causing a computer to function as the above-described image processing apparatus.

本発明によれば、精度の高いサブピクセルレベルの対応点を推定することを可能とする。   According to the present invention, it is possible to estimate a corresponding point at a subpixel level with high accuracy.

所定距離にある物体を撮影した基準画像と参照画像を用いてブロックマッチングを行う方法を説明するための図である。It is a figure for demonstrating the method of performing block matching using the standard image which image | photographed the object in a predetermined distance, and a reference image. 基準画像のブロックに対して参照画像に設定したブロックが所定画素ずれている場合を説明するための図である。It is a figure for demonstrating the case where the block set to the reference image has shifted | deviated the predetermined pixel with respect to the block of a reference | standard image. 図2に示す基準画像のブロックと参照画像のブロックとの相関関係をグラフ上にプロットした図である。FIG. 3 is a diagram in which a correlation between a block of a standard image and a block of a reference image shown in FIG. 2 is plotted on a graph. 本実施形態に係る画像処理装置を含むステレオカメラ装置の構成を示す図である。It is a figure which shows the structure of the stereo camera apparatus containing the image processing apparatus which concerns on this embodiment. 図4に示すレンズアレイにより撮影された画像を示す図である。It is a figure which shows the image image | photographed with the lens array shown in FIG. 本実施形態に係るマッチングブロックについて説明するための図である。It is a figure for demonstrating the matching block which concerns on this embodiment. 本実施形態に係るマッチングブロックが所定画素ずれている例を説明するための図である。It is a figure for demonstrating the example from which the matching block which concerns on this embodiment has shifted | deviated the predetermined pixel. 本実施形態に係る相関演算手段の機能構成を示す図である。It is a figure which shows the function structure of the correlation calculating means which concerns on this embodiment. 本実施形態に係る画像処理装置の機能を実現するハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions which implement | achieve the function of the image processing apparatus which concerns on this embodiment. 本実施形態に係る相関演算処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the correlation calculation process which concerns on this embodiment. 相関演算手段により得られた値を用いたサブピクセルの推定方法を説明するための図である。It is a figure for demonstrating the estimation method of the sub pixel using the value obtained by the correlation calculating means. 本実施形態に係る他のマッチングブロックについて説明するための図である。It is a figure for demonstrating the other matching block which concerns on this embodiment.

以下、本発明の実施の形態について詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail.

<ステレオカメラ装置の構成>
図4及び図5を用いて、本実施形態に係る画像処理装置を含むステレオカメラ装置について説明する。図4は、本実施形態に係る画像処理装置を含むステレオカメラ装置の構成を示している。また、図5は、レンズアレイにより撮像された画像を示している。
<Configuration of stereo camera device>
A stereo camera apparatus including the image processing apparatus according to the present embodiment will be described with reference to FIGS. 4 and 5. FIG. 4 shows a configuration of a stereo camera apparatus including the image processing apparatus according to the present embodiment. FIG. 5 shows an image captured by the lens array.

図4に示すように、本実施形態に係るステレオカメラ装置100は、例えば1台の超小型ステレオカメラであり、撮像手段10と画像処理装置11とを有するように構成される。   As shown in FIG. 4, the stereo camera device 100 according to the present embodiment is, for example, one ultra-small stereo camera, and is configured to include an imaging unit 10 and an image processing device 11.

撮像手段10は、レンズアレイと、画像センサと、遮光壁を有し、左右に視点の異なる画像を撮像する。図5に示す左側の画像Lは、図4に示す右側のレンズBにより撮影した画像であり、図5に示す右側の画像Rは、図4に示す左側のレンズCにより撮影した画像である。   The imaging means 10 has a lens array, an image sensor, and a light shielding wall, and images images with different viewpoints on the left and right. The left image L shown in FIG. 5 is an image taken by the right lens B shown in FIG. 4, and the right image R shown in FIG. 5 is an image taken by the left lens C shown in FIG.

画像処理装置11は、シェーディング補正手段20と、歪み補正手段30と、相関演算手段40と、サブピクセル視差推定手段50と、距離算出手段60とを有するように構成される。   The image processing apparatus 11 is configured to include a shading correction unit 20, a distortion correction unit 30, a correlation calculation unit 40, a subpixel parallax estimation unit 50, and a distance calculation unit 60.

シェーディング補正手段20は、撮像手段10から取得した画像に対してシェーディング補正を実行する。シェーディング補正手段20は、例えば左右のカメラの明るさの差や画像周辺の暗さを修正する。シェーディング補正手段20は、例えば予め画素の輝度値に乗算すべき値を記憶したシェーディング補正用のテーブルを用意しておき、テーブルの値を輝度値に乗じて画素の明暗を補正しても良い。   The shading correction unit 20 performs shading correction on the image acquired from the imaging unit 10. The shading correction means 20 corrects, for example, the difference in brightness between the left and right cameras and the darkness around the image. For example, the shading correction unit 20 may prepare a shading correction table in which a value to be multiplied by the luminance value of the pixel is stored in advance, and correct the brightness of the pixel by multiplying the value of the table by the luminance value.

歪み補正手段30は、シェーディング補正手段20によりシェーディング補正された画像に対して歪み補正を実行する。歪み補正手段30は、例えば左右の画像それぞれが持つ歪みを補正する。歪み補正手段30は、例えばレンズの特性に由来する歪みをもって撮影された画像をピンホールカメラが撮影したような歪みのない画像に補正する。歪み補正手段30は、公知の方法を用いて、例えば予め作成しておいたルックアップテーブルを用いて歪み補正を行っても良く、高次の多項式を用いて歪み状態を近似した補正多項式を用いて歪みを取り除いても良い。   The distortion correction unit 30 performs distortion correction on the image subjected to the shading correction by the shading correction unit 20. The distortion correction unit 30 corrects, for example, distortion of each of the left and right images. The distortion correction unit 30 corrects, for example, an image captured with distortion derived from the characteristics of the lens into an image without distortion as captured by a pinhole camera. The distortion correction unit 30 may perform distortion correction using a known method, for example, using a lookup table prepared in advance, and uses a correction polynomial that approximates the distortion state using a higher-order polynomial. The distortion may be removed.

相関演算手段40は、歪み補正手段30により歪みが補正された左右の画像に対してブロックマッチングを用いながら左右の画像の相関を計算する。このとき、左右の画像の一方を基準画像とし、他方を参照画像とする。なお、以下の例では、相関演算手段40は、図5に示す左側の画像L(右側のレンズBで撮影された画像)を基準画像、右側の画像R(左側のレンズCで撮影された画像)を参照画像として、ブロックマッチングを行いながら左右の画像の相関値を算出するが、本発明においてはこれに限定されるものではなく、基準画像と参照画像を逆にしても良い。なお、相関演算手段40による具体的な相関演算方法については後述する。   The correlation calculation means 40 calculates the correlation between the left and right images using block matching for the left and right images whose distortion has been corrected by the distortion correction means 30. At this time, one of the left and right images is set as a standard image, and the other is set as a reference image. In the following example, the correlation calculation means 40 uses the left image L (image taken by the right lens B) shown in FIG. 5 as a reference image and the right image R (image taken by the left lens C). ) As a reference image, the correlation value of the left and right images is calculated while performing block matching. However, the present invention is not limited to this, and the reference image and the reference image may be reversed. A specific correlation calculation method by the correlation calculation means 40 will be described later.

サブピクセル視差推定手段50は、相関演算手段40により得られた相関評価値及び極値位置に基づき、サブピクセル視差を推定する。例えばサブピクセル視差推定手段50は、相関の評価値列を入力とし、視差の評価値の極小値(例えばSSD、SAD)、あるいは極大値(NCC)を与える相関評価値とその評価値の左右にある1画素ずらした位置での相関評価値を取得する。   The subpixel parallax estimation unit 50 estimates the subpixel parallax based on the correlation evaluation value and the extreme value position obtained by the correlation calculation unit 40. For example, the sub-pixel parallax estimation unit 50 receives a correlation evaluation value sequence as an input, and sets a correlation evaluation value that gives a minimum value (for example, SSD, SAD) or a maximum value (NCC) of the parallax evaluation value, and left and right of the evaluation value. A correlation evaluation value at a position shifted by one pixel is acquired.

また、サブピクセル視差推定手段50は、上述のように算出した3つの評価値から対応点のサブピクセル位置を推定する。例えば、サブピクセル視差推定手段50は、SADをブロックマッチングに使用した場合には、等角直線フィッティングを用いて対応点のサブピクセル位置を推定する。また、サブピクセル視差推定手段50は、SSDやNCCを用いた場合には2次曲線フィッティングを用いて対応点のサブピクセル値を推定する。なお、等角直線フィッティング及び2次曲線フィッティングを用いた推定方法については後述する。   The sub-pixel parallax estimation unit 50 estimates the sub-pixel position of the corresponding point from the three evaluation values calculated as described above. For example, when the SAD is used for block matching, the subpixel parallax estimation unit 50 estimates the subpixel position of the corresponding point using equiangular straight line fitting. Further, the sub-pixel parallax estimation means 50 estimates the sub-pixel value of the corresponding point using quadratic curve fitting when SSD or NCC is used. An estimation method using equiangular straight line fitting and quadratic curve fitting will be described later.

距離算出手段60は、サブピクセル視差推定手段50により推定された対応点のサブピクセル位置(サブピクセルレベルの視差)を用いて被写体(対象物)までの距離を算出する。距離算出手段60は、例えば被写体までの距離を計算する式としてZ=Bf/(D−offset)を用いて上述した点Aにおける被写体までの距離を算出する。ここで、Zは被写体までの距離を意味し、Bは基線長(レンズ間の距離)を意味し、fは焦点距離を意味し、Dは視差を意味する。   The distance calculation unit 60 calculates the distance to the subject (object) using the subpixel position (subpixel level parallax) of the corresponding point estimated by the subpixel parallax estimation unit 50. The distance calculating means 60 calculates the distance to the subject at the point A described above using, for example, Z = Bf / (D-offset) as an expression for calculating the distance to the subject. Here, Z means the distance to the subject, B means the base length (distance between lenses), f means the focal length, and D means the parallax.

距離算出手段60は、上述した式を用いて距離が計算可能な画素全てに対して、距離を算出する。これにより、距離画像が得られる。   The distance calculation means 60 calculates the distance for all pixels whose distance can be calculated using the above-described formula. Thereby, a distance image is obtained.

<本実施形態に係るマッチングブロックについて>
次に、図6及び図7を用いて、本実施形態に係るマッチングブロックについて説明する。図6は、本実施形態に係るマッチングブロックについて説明するための図である。また、図7は、本実施形態に係るマッチングブロックが所定画素ずれている例を説明するための図である。
<About the matching block according to this embodiment>
Next, the matching block according to the present embodiment will be described with reference to FIGS. 6 and 7. FIG. 6 is a diagram for explaining the matching block according to the present embodiment. FIG. 7 is a diagram for explaining an example in which the matching block according to this embodiment is shifted by a predetermined pixel.

図6(A)に示すように、基準画像の対応点探索を行う点を点Aとして設定し、その点Aを中心としたブロックを設定する。本実施形態では、例えばブロックの形状の一例として菱形を用いることとし、そのサイズを菱形の対角線を基準に設定するものとし、例えば対角線で横方向16画素、縦方向16画素とする。なお、画素数については、これに限定されるものではない。   As shown in FIG. 6A, a point for searching for a corresponding point in the reference image is set as a point A, and a block centered on the point A is set. In the present embodiment, for example, a rhombus is used as an example of the shape of the block, and the size is set with reference to the diagonal of the rhombus. For example, the diagonal is 16 pixels in the horizontal direction and 16 pixels in the vertical direction. Note that the number of pixels is not limited to this.

次に、図6(B)に示すように、図6(A)において設定したブロックと同一サイズの同一形状のブロックを参照画像上に複数設定する。   Next, as shown in FIG. 6B, a plurality of blocks having the same size and the same shape as the blocks set in FIG. 6A are set on the reference image.

相関演算手段40は、基準画像の点Aを中心とした菱形のブロックと、参照画像上に複数設定したブロックとの相関を計算し、その評価値を得る。なお、本実施形態では、ステレオ画像の性質上、左側の画像L(基準画像)の点Aに対応する点は、右側の画像R(参照画像)上では点Aに相当する位置と同じ位置にあるか、その位置より右側にしか存在しない。   The correlation calculation means 40 calculates the correlation between the rhombus block centered on the point A of the standard image and a plurality of blocks set on the reference image, and obtains the evaluation value. In the present embodiment, due to the nature of the stereo image, the point corresponding to the point A of the left image L (reference image) is at the same position as the position corresponding to the point A on the right image R (reference image). It exists or exists only on the right side of the position.

したがって、参照画像の複数のブロックの位置は、図6(B)に示すように、点Aと同じ位置の水平ライン上を左に数画素(最低1画素)移動させた位置から右に測定したい最短距離に相当する視差分の画素に、更に数画素(最低1画素)だけ移動させた位置まで1画素ずつ移動させて設定する。   Therefore, as shown in FIG. 6B, the positions of a plurality of blocks of the reference image are to be measured to the right from the position moved several pixels (at least one pixel) to the left on the horizontal line at the same position as the point A. The pixels corresponding to the shortest distance are set by moving one pixel at a time to a position further moved by several pixels (at least one pixel).

上述のように左右に設定する余分な数画素のブロック位置は、例えばサブピクセル視差を推定するために1画素ずつ必要であり、また基準画像と参照画像とがレンズの製造誤差等によりオフセットをもつ場合に備えるためである。   As described above, the block positions of extra several pixels set to the left and right are necessary for each pixel, for example, to estimate the sub-pixel parallax, and the reference image and the reference image have an offset due to lens manufacturing error or the like This is to prepare for the case.

相関演算手段40による相関評価値の算出方法は、従来用いられているSAD、SSD、NCC等を用いると良い。図6に示すブロック形状の場合には、上述した図1に示すような画像を撮影した場合でも、図2の例とは異なる比較が行われる。例えば、図7(A)〜(C)では、菱形ブロックどうしを比較することになり、ブロック端付近での相関を低下させる画素輝度値の大きな差を軽減することが可能になる。   As a method for calculating the correlation evaluation value by the correlation calculation means 40, SAD, SSD, NCC, or the like that is conventionally used may be used. In the case of the block shape shown in FIG. 6, even when an image as shown in FIG. 1 is taken, a comparison different from the example of FIG. 2 is performed. For example, in FIGS. 7A to 7C, the rhombus blocks are compared with each other, and it is possible to reduce a large difference in pixel luminance values that reduce the correlation near the block end.

すなわち、上述した図2におけるブロック端での相関を低下させる原因を大きく低減させて、中心付近の位置ずれのみが相関に反映されることになり、望ましい相関の評価値を得ることが可能となる。   That is, the cause of lowering the correlation at the block end in FIG. 2 described above is greatly reduced, and only the positional deviation near the center is reflected in the correlation, and a desired correlation evaluation value can be obtained. .

<相関演算手段の機能構成>
次に、図8を用いて、上述した相関演算手段40の機能構成に説明する。図8は、本実施形態に係る相関演算手段の機能構成を示している。図8に示すように相関演算手段40は、ブロック形状設定手段41と、基準画像ブロック位置設定手段42と、参照画像ブロック位置設定手段43と、評価値演算手段44と、極値検出手段45とを有するように構成される。
<Functional configuration of correlation calculation means>
Next, the functional configuration of the correlation calculation means 40 described above will be described with reference to FIG. FIG. 8 shows a functional configuration of the correlation calculation means according to this embodiment. As shown in FIG. 8, the correlation calculation means 40 includes a block shape setting means 41, a standard image block position setting means 42, a reference image block position setting means 43, an evaluation value calculation means 44, and an extreme value detection means 45. It is comprised so that it may have.

ブロック形状設定手段41は、例えば2つの画像の一方を基準画像、他方を参照画像としてマッチングブロックを行うための演算ブロックの形状(ブロック形状)と大きさを設定する。ここで、ブロック形状設定手段41は、基準画像において対応点探索を行う所定の点を中心としたブロックを設定する場合に、基準画像に含まれる被写体である対象物の形状に応じてブロック形状を設定すると良い。   The block shape setting unit 41 sets, for example, the shape (block shape) and size of a calculation block for performing a matching block using one of the two images as a standard image and the other as a reference image. Here, the block shape setting means 41 sets the block shape according to the shape of the object that is the subject included in the reference image when setting a block centering on a predetermined point for which the corresponding point search is performed in the reference image. It is good to set.

具体的には、ブロック形状設定手段41は、対象物の境界部分に沿った垂直線を含まない形状をブロック形状として設定し、例えばブロック形状を菱形形状、垂直線を含まない六角形等の多角形形状、円形形状、楕円形状等に設定すると良い。ブロック形状設定手段41は、例えばブロック形状を菱形形状とする場合、例えば所定の点を中心として対角線で横方向16画素、縦方向16画素とするブロック形状を設定する。   Specifically, the block shape setting unit 41 sets a shape that does not include a vertical line along the boundary portion of the target object as a block shape. For example, the block shape is a rhombus shape or a hexagon that does not include a vertical line. It may be set to a square shape, a circular shape, an elliptical shape, or the like. For example, when the block shape is a rhombus shape, the block shape setting unit 41 sets a block shape having 16 pixels in the horizontal direction and 16 pixels in the vertical direction with a predetermined point as a center.

また、ブロック形状設定手段41は、予め設定された形状の異なる複数のブロック形状のうち、対象物に応じて少なくとも一つのブロック形状を設定しても良い。   Further, the block shape setting means 41 may set at least one block shape according to the object among a plurality of block shapes having different preset shapes.

基準画像ブロック位置設定手段42は、ブロック形状設定手段41により設定されたブロック形状に基づいて、基準画像におけるブロック位置を設定する。   The reference image block position setting unit 42 sets a block position in the reference image based on the block shape set by the block shape setting unit 41.

参照画像ブロック位置設定手段43は、参照画像において、基準画像ブロック位置設定手段42で設定されたブロック位置に対応する位置の近傍に複数のブロックを設定する。参照画像ブロック位置設定手段43は、図6等において説明したように、例えば所定の点(図6の例では点A)と同じ位置の水平ライン上を左に数画素(最低1画素以上)移動させた位置から右に測定したい最短距離に相当する視差分の画素に、更に数画素(最低1画素以上)移動させた位置まで1画素ずつ移動させて設定する。   The reference image block position setting unit 43 sets a plurality of blocks in the vicinity of the position corresponding to the block position set by the standard image block position setting unit 42 in the reference image. The reference image block position setting means 43 moves several pixels (at least one pixel or more) to the left on the horizontal line at the same position as a predetermined point (point A in the example of FIG. 6), for example, as described in FIG. The setting is made by moving one pixel at a time to a position where several pixels (at least one pixel or more) are moved to the pixel corresponding to the shortest distance to be measured to the right from the position.

評価値演算手段44は、基準ブロック位置設定手段42により設定された基準画像内のブロックと、参照画像ブロック位置設定手段43により参照画像内に設定された複数のブロックとをそれぞれ所定の演算を行うことで相関評価値を算出する。評価値演算手段44は、相関評価値を算出する所定の演算として、上述したSAD、SSD、NCC等を用いて、上述した各ブロック間の相関評価値を得る。   The evaluation value calculation means 44 performs predetermined calculations on the blocks in the reference image set by the reference block position setting means 42 and the plurality of blocks set in the reference image by the reference image block position setting means 43, respectively. Thus, the correlation evaluation value is calculated. The evaluation value calculation means 44 uses the above-described SAD, SSD, NCC, etc. as the predetermined calculation for calculating the correlation evaluation value, and obtains the above-described correlation evaluation value between each block.

極値検出手段45は、評価値演算手段44により得られた複数の相関評価値からその極値とその位置を検出し、複数の相関評価値及びその極値の位置を出力する。   The extreme value detection means 45 detects the extreme value and its position from the plurality of correlation evaluation values obtained by the evaluation value calculation means 44, and outputs the plurality of correlation evaluation values and the position of the extreme value.

<ハードウェア構成>
次に、図9を用いて、上述した画像処理装置11の機能を実現するハードウェア構成について説明する。図9は、本実施形態に係る画像処理装置の機能を実現するハードウェア構成の一例を示している。
<Hardware configuration>
Next, a hardware configuration for realizing the functions of the above-described image processing apparatus 11 will be described with reference to FIG. FIG. 9 shows an example of a hardware configuration that implements the functions of the image processing apparatus according to the present embodiment.

図9に示す画像処理装置11には、入力装置71と、出力装置72と、ドライブ装置73と、補助記憶装置74と、メモリ装置75と、各種制御を行う演算処理装置(CPU:Central Processing Unit)76と、ネットワーク接続装置77と、記録媒体78とを有するよう構成されており、これらはシステムバスBで相互に接続されている。   The image processing apparatus 11 shown in FIG. 9 includes an input device 71, an output device 72, a drive device 73, an auxiliary storage device 74, a memory device 75, and an arithmetic processing unit (CPU: Central Processing Unit) that performs various controls. ) 76, a network connection device 77, and a recording medium 78, which are connected to each other via a system bus B.

入力装置71は、ユーザが操作する操作ボタン等を有しており、ユーザからのプログラムの実行等、各種操作信号を入力する。出力装置72は、本発明における処理を行うのに必要な各種ウィンドウやデータ等を表示するディスプレイ等を有し、CPU76が有する制御プログラムによりプログラムの実行経過や結果等を表示することができる。   The input device 71 has operation buttons and the like operated by the user, and inputs various operation signals such as execution of a program from the user. The output device 72 has a display or the like for displaying various windows and data necessary for performing the processing in the present invention, and can display the program execution progress, results, and the like by the control program of the CPU 76.

ここで、画像処理装置11にインストールされる実行プログラムは、記録媒体78等により提供される。プログラムを記録した記録媒体78は、ドライブ装置73にセット可能であり、記録媒体78に含まれる実行プログラムが、記録媒体78からドライブ装置73を介して補助記憶装置74にインストールされる。   Here, the execution program installed in the image processing apparatus 11 is provided by the recording medium 78 or the like. The recording medium 78 on which the program is recorded can be set in the drive device 73, and the execution program included in the recording medium 78 is installed from the recording medium 78 to the auxiliary storage device 74 via the drive device 73.

なお、記録媒体78は、例えばCD−ROMの他、フレキシブルディスク、光磁気ディスク等のように情報を光学的、電気的或いは磁気的に記録する記録媒体、ROM、フラッシュメモリ等のように情報を電気的に記録する半導体メモリ等、様々なタイプの記録媒体を用いることができる。   The recording medium 78 is, for example, a CD-ROM, a recording medium for optically, electrically, or magnetically recording information such as a flexible disk or a magneto-optical disk, a ROM, a flash memory, or the like. Various types of recording media such as a semiconductor memory for electrical recording can be used.

補助記憶装置74は、ハードディスク等のストレージ手段であり、本発明における実行プログラムや、コンピュータに設けられた制御プログラム、各種データ等を蓄積し必要に応じて入出力を行うことができる。   The auxiliary storage device 74 is a storage means such as a hard disk, and can store an execution program according to the present invention, a control program provided in a computer, various data, etc., and perform input / output as necessary.

メモリ装置75は、CPU76により補助記憶装置74から読み出された実行プログラム等を格納する。なお、メモリ装置75は、ROM(Read Only Memory)やRAM(Random Access Memory)等からなる。   The memory device 75 stores an execution program or the like read from the auxiliary storage device 74 by the CPU 76. The memory device 75 includes a ROM (Read Only Memory), a RAM (Random Access Memory), and the like.

CPU76は、OS(Operating System)等の制御プログラム、メモリ装置75により格納されている実行プログラムに基づいて、各種演算や各ハードウェア構成部とのデータの入出力等、コンピュータ全体の処理を制御して上述した各機能及び後述する相関演算処理を実現することができる。また、プログラムの実行中に必要な各種情報は、補助記憶装置78から取得することができ、また格納することもできる。   The CPU 76 controls processing of the entire computer, such as various operations and input / output of data with each hardware component, based on a control program such as an OS (Operating System) and an execution program stored in the memory device 75. Thus, the above-described functions and correlation calculation processing described later can be realized. Various kinds of information required during the execution of the program can be acquired from the auxiliary storage device 78 and stored.

ネットワーク接続装置77は、通信ネットワーク等と接続することにより、実行プログラムを通信ネットワークに接続されている他の端末等から取得したり、プログラムを実行して得られる実行結果又は本発明における実行プログラム自体を他の端末等に提供したりすることができる。   The network connection device 77 obtains an execution program from another terminal connected to the communication network by connecting to a communication network or the like, or an execution result obtained by executing the program or the execution program itself in the present invention. Can be provided to other terminals.

上述したようなハードウェア構成により、特別な装置構成を必要とせず、低コストで効率的に上述した各機能及び後述する相関演算処理を実現することができる。また、プログラムをインストールすることにより、上述した各機能及び後述する各相関演算処理を容易に実現することができる。   With the hardware configuration as described above, it is possible to realize each function described above and a correlation calculation process described later efficiently at a low cost without requiring a special device configuration. Further, by installing the program, each function described above and each correlation calculation process described later can be easily realized.

<相関演算処理について>
次に、図10を用いて、上述した相関演算手段40による相関演算処理の流れについて説明する。図10は、本実施形態に係る相関演算処理の流れを示すフローチャートである。
<About correlation calculation processing>
Next, the flow of the correlation calculation process by the correlation calculation means 40 described above will be described with reference to FIG. FIG. 10 is a flowchart showing the flow of correlation calculation processing according to the present embodiment.

図10に示すように、相関演算手段40に、上述した各補正手段により補正された基準画像、参照画像が入力されると(S10)、ブロック形状設定手段41は、ブロックマッチングに用いるブロック形状を設定する(S11)。   As shown in FIG. 10, when the standard image and the reference image corrected by each of the correction units described above are input to the correlation calculation unit 40 (S10), the block shape setting unit 41 determines the block shape used for block matching. Set (S11).

次に、基準画像ブロック位置設定手段42は、ブロック形状設定手段41により設定されたブロック形状を用いて基準画像のブロック位置を設定する(S12)。   Next, the reference image block position setting unit 42 sets the block position of the reference image using the block shape set by the block shape setting unit 41 (S12).

次に、参照画像ブロック位置設定手段43は、参照画像において基準画像ブロック位置設定手段41により設定されたブロック位置に対応する位置の近傍に複数のブロック位置を設定する(S13)。   Next, the reference image block position setting unit 43 sets a plurality of block positions in the vicinity of the position corresponding to the block position set by the standard image block position setting unit 41 in the reference image (S13).

次に、評価値演算手段44は、基準ブロック位置設定手段42により設定された基準画像内のブロックと、参照画像ブロック位置設定手段43により参照画像内に設定された複数のブロックとをそれぞれ所定の演算を行うことにより相関評価値を算出する(S14)。   Next, the evaluation value calculation unit 44 determines a block in the reference image set by the reference block position setting unit 42 and a plurality of blocks set in the reference image by the reference image block position setting unit 43, respectively. A correlation evaluation value is calculated by performing an operation (S14).

次に、相関演算手段40により入力された全画素に対して処理がなされたか判断する(S15)。全画素に対して処理がなされていないと判断した場合には(S15において、NO)、S12の処理に戻り、他の画素について同様の処理を行う。   Next, it is determined whether or not processing has been performed on all the pixels input by the correlation calculation means 40 (S15). If it is determined that processing has not been performed for all pixels (NO in S15), the process returns to S12, and the same processing is performed for the other pixels.

全画素に対して処理がなされたと判断された場合には(S15において、YES)、極値検出手段45は、評価値演算手段44により得られた複数の相関評価値からその極値とその位置を検出し(S16)、複数の相関評価値及びその極値位置を出力し(S17)、処理を終了する。   If it is determined that processing has been performed for all pixels (YES in S15), extreme value detection means 45 determines the extreme value and its position from a plurality of correlation evaluation values obtained by evaluation value calculation means 44. Is detected (S16), a plurality of correlation evaluation values and their extreme positions are output (S17), and the process is terminated.

<サブピクセルの推定方法>
次に、図11を用いて、上述した相関演算手段40により得られた相関評価値及び極値位置に基づきサブピクセルを推定する方法について説明する。図11は、相関演算手段により得られた値を用いたサブピクセルの推定方法を説明するための図である。なお、図11(A)は、等角直線を用いたフィッティングを示す図である。横軸は、探索画素位置を示し、縦軸はSAD評価値を示している。
<Subpixel estimation method>
Next, a method for estimating a subpixel based on the correlation evaluation value and the extreme value position obtained by the correlation calculation means 40 will be described with reference to FIG. FIG. 11 is a diagram for explaining a subpixel estimation method using values obtained by the correlation calculation means. Note that FIG. 11A is a diagram showing fitting using an equiangular straight line. The horizontal axis indicates the search pixel position, and the vertical axis indicates the SAD evaluation value.

サブピクセル視差推定手段50は、図11(A)に示す図から対応点のサブピクセル位置を推定するため、まず、SAD評価値の一番小さいP1と、P1と隣接する2つのSAD評価値(P0とP2)のうち評価値の大きいP0とを結ぶ直線を引く。次に、P2を通り、P0とP1を結んだ直線を左右反転させた直線と平行な直線を引く。次に、サブピクセル視差推定手段50は、2つの直線の交点を対応点のサブピクセル位置として推定する。   In order to estimate the subpixel position of the corresponding point from the diagram shown in FIG. 11A, the subpixel parallax estimation unit 50 firstly has P1 having the smallest SAD evaluation value and two SAD evaluation values adjacent to P1 ( A straight line connecting P0 and P0 having a large evaluation value is drawn. Next, a straight line that passes through P2 and is parallel to a straight line obtained by horizontally inverting the straight line connecting P0 and P1 is drawn. Next, the subpixel parallax estimation means 50 estimates the intersection of two straight lines as the subpixel position of the corresponding point.

図11(B)は、2次曲線を用いたフィッティングを示す図である。横軸は、探索画素位置を示し、縦軸は、SSD評価値を示している。   FIG. 11B is a diagram showing fitting using a quadratic curve. The horizontal axis indicates the search pixel position, and the vertical axis indicates the SSD evaluation value.

サブピクセル視差推定手段50は、図11(B)に示す図から対応点のサブピクセル位置を推定するため、まず、図11(B)に示す3点(P0、P1、P2)を用いて、2次曲線の当てはめを行い、2次曲線の頂点を決定する。サブピクセル視差推定手段50は、この頂点の位置を対応点のサブピクセル位置として推定する。   In order to estimate the subpixel position of the corresponding point from the diagram shown in FIG. 11B, the subpixel parallax estimation means 50 first uses the three points (P0, P1, P2) shown in FIG. A quadratic curve is fitted and the vertex of the quadratic curve is determined. The subpixel parallax estimation means 50 estimates the position of this vertex as the subpixel position of the corresponding point.

上述したように、サブピクセル視差推定手段50によりサブピクセルレベルの視差(対応点)を検出することができる。   As described above, the sub-pixel parallax estimation means 50 can detect the sub-pixel level parallax (corresponding point).

<その他のブロック形状>
次に、図12を用いて、本実施形態に係る他のマッチングブロックの例について説明する。図12は、本実施形態に係る他のマッチングブロックについて説明するための図である。上述したように、世の中の風景や人間が作った構造物は垂直方向にその境界をもつものが大部分を占めるため、ブロック形状を被写体との平行部分が小さいようなものであれば菱形以外でも効果がある。
<Other block shapes>
Next, an example of another matching block according to the present embodiment will be described with reference to FIG. FIG. 12 is a diagram for explaining another matching block according to the present embodiment. As mentioned above, most of the world's landscapes and human-made structures have their boundaries in the vertical direction. effective.

図12(A)は、ブロック形状を円状にした場合を示している。上述した16×16画素の菱形のブロック形状は、例えば16×16画素の正方形よりも相関に使用する画素数が小さく、ノイズの影響を受けやすい場合も考えられるため、円状のブロック形状を用いてブロックマッチングを行っても良い。   FIG. 12A shows a case where the block shape is circular. Since the 16 × 16 pixel rhombus block shape described above has a smaller number of pixels used for correlation than a 16 × 16 pixel square and is likely to be affected by noise, for example, a circular block shape is used. Block matching may be performed.

図12(B)は、ブロック形状を六角形にした場合を示している。六角形のブロック形状の場合には、例えば16×16画素の正方形のブロックに近い画素数を確保することができるため、ノイズの耐性とサブピクセル推定精度とを両立することが可能となる。   FIG. 12B shows a case where the block shape is a hexagon. In the case of a hexagonal block shape, for example, the number of pixels close to a square block of 16 × 16 pixels can be secured, so that it is possible to achieve both noise resistance and subpixel estimation accuracy.

また、上述したブロック形状の他にも例えば星形や、正方形等の多角形の中心を基準として所定の角度(例えば60度右回転等)だけ回転させて、被写体等の対象物の境界部分(例えば輪郭形状)等と平行にならない形状を生成しても良い。   In addition to the block shape described above, for example, a boundary portion of an object such as a subject (by rotating a predetermined angle (for example, 60 ° clockwise rotation)) with reference to the center of a polygon such as a star or a square For example, a shape that is not parallel to the contour shape may be generated.

また、本実施形態では、上述したブロック形状を予め複数蓄積しておき、被写体の形状(例えば、輪郭形状や模様等)や種類(例えば、人、建物、山、月等)等に応じて、不一致度の高い形状を選択するようにしても良く、ユーザがブロック形状を適宜選択できるようにしても良い。なお、本実施形態では、上述した複数のブロック形状のうち少なくとも一つのブロック形状が設定され、複数選択された場合には、例えば位置や時間等に応じて切り換えても良く、また画像中に含まれる被写体の変更に伴って変更しても良い。   In the present embodiment, a plurality of the block shapes described above are stored in advance, and depending on the shape (for example, contour shape or pattern) or the type (for example, person, building, mountain, moon, etc.) of the subject, A shape with a high degree of mismatch may be selected, or the user may be able to select a block shape as appropriate. In the present embodiment, at least one block shape among the plurality of block shapes described above is set, and when a plurality of block shapes are selected, they may be switched according to, for example, the position and time, and are included in the image. It may be changed as the subject to be changed.

上述したように、本発明の実施形態によれば、世の中の被写体に応じた形状のブロックを設定するブロックマッチングを用いた対応点探索を実行することで、最適な相関を得て、精度の高いサブピクセルレベルの対応点(サブピクセルレベルの視差)を推定し、精度の高いサブピクセル推定を行うことが可能となる。また、上述したサブピクセルレベルの対応点の推定は、ステレオカメラを用いた測距装置や3次元形状認識装置等に用いても良い。   As described above, according to the embodiment of the present invention, an optimum correlation is obtained by performing a corresponding point search using block matching for setting a block having a shape according to a subject in the world, and is highly accurate. It is possible to estimate sub-pixel level corresponding points (sub-pixel level parallax) and perform highly accurate sub-pixel estimation. In addition, the above-described estimation of corresponding points at the sub-pixel level may be used for a distance measuring device using a stereo camera, a three-dimensional shape recognition device, or the like.

以上、本発明の好ましい実施例について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形、変更が可能である。   The preferred embodiments of the present invention have been described in detail above, but the present invention is not limited to such specific embodiments, and various modifications can be made within the scope of the gist of the present invention described in the claims. Can be changed.

10 撮像手段
11 画像処理装置
20 シェーディング補正手段
30 歪み補正手段
40 相関演算手段
41 ブロック形状設定手段
42 基準画像ブロック位置設定手段
43 参照画像ブロック位置設定手段
44 評価値演算手段
45 極値検出手段
50 サブピクセル視差推定手段
60 距離算出手段
71 入力装置
72 出力装置
73 ドライブ装置
74 補助記憶装置
75 メモリ装置
76 演算処理装置
77 ネットワーク接続装置
78 記録媒体
100 ステレオカメラ装置
DESCRIPTION OF SYMBOLS 10 Imaging means 11 Image processing apparatus 20 Shading correction means 30 Distortion correction means 40 Correlation calculation means 41 Block shape setting means 42 Reference image block position setting means 43 Reference image block position setting means 44 Evaluation value calculation means 45 Extreme value detection means 50 Sub Pixel parallax estimation means 60 Distance calculation means 71 Input device 72 Output device 73 Drive device 74 Auxiliary storage device 75 Memory device 76 Arithmetic processing device 77 Network connection device 78 Recording medium 100 Stereo camera device

特開2001−195597号公報JP 2001-195597 A 特開2009−282635号公報JP 2009-282635 A 特開平5−256613号公報JP-A-5-256613 特許第4382156号公報Japanese Patent No. 4382156

新井元基,鷲見和彦,松山隆司,「画像のブロックマッチングにおける相関関数とサブピクセル推定方式の最適化」,情報処理学会 研究報告,May 2004, CVIM-144-5, pp.33-40Motoki Arai, Kazuhiko Sumi, Takashi Matsuyama, “Optimization of correlation function and subpixel estimation method in image block matching”, Information Processing Society of Japan, May 2004, CVIM-144-5, pp.33-40 "A Stereo Matching Algorithm with an Adaptive Window: Theory and Experiment", Takeo Kanade and Masatoshi Okutomi, IEEE PAMI, Vol. 16, NO.9, Sep. 1994"A Stereo Matching Algorithm with an Adaptive Window: Theory and Experiment", Takeo Kanade and Masatoshi Okutomi, IEEE PAMI, Vol. 16, NO.9, Sep. 1994

Claims (6)

2つの画像の一方を基準画像、他方を参照画像としてマッチングブロックを行うためのブロック形状を設定するブロック形状設定手段と、
前記ブロック形状設定手段により設定されたブロック形状に基づいて、前記基準画像におけるブロック位置を設定する基準画像ブロック位置設定手段と、
前記参照画像において、前記基準画像ブロック位置設定手段により設定されたブロック位置に対応する位置の近傍に複数のブロックを設定する参照画像ブロック位置設定手段と、
前記基準画像内に設定されたブロックと、前記参照画像ブロック位置設定手段により設定された複数のブロックとの相関評価値を算出する評価値演算手段とを有し、
前記ブロック形状設定手段は、前記基準画像の含まれる対象物の形状に応じて前記ブロック形状を設定することを特徴とする画像処理装置。
A block shape setting means for setting a block shape for performing a matching block using one of the two images as a standard image and the other as a reference image;
Reference image block position setting means for setting a block position in the reference image based on the block shape set by the block shape setting means;
In the reference image, reference image block position setting means for setting a plurality of blocks in the vicinity of a position corresponding to the block position set by the standard image block position setting means;
Evaluation value calculation means for calculating a correlation evaluation value between a block set in the reference image and a plurality of blocks set by the reference image block position setting means;
The image processing apparatus, wherein the block shape setting means sets the block shape according to the shape of an object included in the reference image.
前記ブロック形状設定手段は、前記対象物の境界部分に沿った垂直線を含まない形状を前記ブロック形状として設定することを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the block shape setting unit sets a shape that does not include a vertical line along a boundary portion of the object as the block shape. 前記ブロック形状設定手段は、前記ブロック形状を菱形形状、前記対象物の境界部分に沿った垂直線を含まない多角形形状、円形形状、及び、楕円形状のうち、少なくとも一つに設定することを特徴とする請求項2に記載の画像処理装置。   The block shape setting means sets the block shape to at least one of a rhombus shape, a polygonal shape not including a vertical line along a boundary portion of the object, a circular shape, and an elliptical shape. The image processing apparatus according to claim 2. 前記ブロック形状設定手段は、予め設定された形状の異なる複数のブロック形状のうち、前記対象物に応じて少なくとも一つのブロック形状を設定することを特徴とする請求項1乃至3のいずれか一項に記載の画像処理装置。   The said block shape setting means sets at least 1 block shape according to the said object among several block shapes from which the preset shape differs, The any one of Claim 1 thru | or 3 characterized by the above-mentioned. An image processing apparatus according to 1. 2つの画像の一方を基準画像、他方を参照画像としてマッチングブロックを行うためのブロック形状を設定するブロック形状設定手順と、
前記ブロック形状設定手順により設定されたブロック形状に基づいて、前記基準画像におけるブロック位置を設定する基準画像ブロック位置設定手順と、
前記参照画像において、前記基準画像ブロック位置設定手順により設定されたブロック位置に対応する位置の近傍に複数のブロックを設定する参照画像ブロック位置設定手順と、
前記基準画像内に設定されたブロックと、前記参照画像ブロック位置設定手順により設定された複数のブロックとの相関評価値を算出する評価値演算手順とを有し、
前記ブロック形状設定手順は、前記基準画像の含まれる対象物の形状に応じて前記ブロック形状を設定することを特徴とする画像処理方法。
A block shape setting procedure for setting a block shape for performing a matching block using one of the two images as a standard image and the other as a reference image;
A reference image block position setting procedure for setting a block position in the reference image based on the block shape set by the block shape setting procedure;
In the reference image, a reference image block position setting procedure for setting a plurality of blocks in the vicinity of a position corresponding to the block position set by the standard image block position setting procedure;
An evaluation value calculation procedure for calculating a correlation evaluation value between a block set in the reference image and a plurality of blocks set by the reference image block position setting procedure;
The block shape setting procedure sets the block shape according to the shape of an object included in the reference image.
コンピュータを、請求項1乃至4のいずれか一項に記載の画像処理装置として機能させるための画像処理プログラム。   An image processing program for causing a computer to function as the image processing apparatus according to any one of claims 1 to 4.
JP2011061743A 2011-03-18 2011-03-18 Image processing apparatus, image processing method, and image processing program Expired - Fee Related JP5782766B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011061743A JP5782766B2 (en) 2011-03-18 2011-03-18 Image processing apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011061743A JP5782766B2 (en) 2011-03-18 2011-03-18 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2012198712A true JP2012198712A (en) 2012-10-18
JP5782766B2 JP5782766B2 (en) 2015-09-24

Family

ID=47180869

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011061743A Expired - Fee Related JP5782766B2 (en) 2011-03-18 2011-03-18 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP5782766B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015133108A (en) * 2014-01-10 2015-07-23 ホンダ リサーチ インスティテュート ヨーロッパ ゲーエムベーハーHonda Research Institute Europe GmbH Method of analyzing related image, image processing system, vehicle having the system, and computer program product
JP7448633B2 (en) 2020-03-05 2024-03-12 ファナック株式会社 A three-dimensional measuring device that generates position information on the surface of an object based on images captured by multiple cameras.

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005084698A (en) * 2003-09-04 2005-03-31 Sony Corp Image processing apparatus and method, recording medium, program, and electronic circuit
JP2009109666A (en) * 2007-10-29 2009-05-21 Toshiba Corp Resolution conversion apparatus, method and program
US20100150455A1 (en) * 2008-02-12 2010-06-17 Ichiro Oyama Compound eye imaging apparatus, distance measuring apparatus, disparity calculation method, and distance measuring method
JP2010250452A (en) * 2009-04-14 2010-11-04 Tokyo Univ Of Science Arbitrary viewpoint image synthesizing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005084698A (en) * 2003-09-04 2005-03-31 Sony Corp Image processing apparatus and method, recording medium, program, and electronic circuit
JP2009109666A (en) * 2007-10-29 2009-05-21 Toshiba Corp Resolution conversion apparatus, method and program
US20100150455A1 (en) * 2008-02-12 2010-06-17 Ichiro Oyama Compound eye imaging apparatus, distance measuring apparatus, disparity calculation method, and distance measuring method
JP2010250452A (en) * 2009-04-14 2010-11-04 Tokyo Univ Of Science Arbitrary viewpoint image synthesizing device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
松岡 洋平: "視差境界を考慮したブロックマッチングによる中間視点画像生成", 2000年電子情報通信学会総合大会 予稿集, JPN6014047298, 7 March 2000 (2000-03-07), JP, pages 110, ISSN: 0002935861 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015133108A (en) * 2014-01-10 2015-07-23 ホンダ リサーチ インスティテュート ヨーロッパ ゲーエムベーハーHonda Research Institute Europe GmbH Method of analyzing related image, image processing system, vehicle having the system, and computer program product
JP7448633B2 (en) 2020-03-05 2024-03-12 ファナック株式会社 A three-dimensional measuring device that generates position information on the surface of an object based on images captured by multiple cameras.

Also Published As

Publication number Publication date
JP5782766B2 (en) 2015-09-24

Similar Documents

Publication Publication Date Title
US10621783B2 (en) Image processing method and apparatus using depth value estimation
JP6271609B2 (en) Autofocus for stereoscopic cameras
US10268901B2 (en) Quasi-parametric optical flow estimation
US8326025B2 (en) Method for determining a depth map from images, device for determining a depth map
US8452081B2 (en) Forming 3D models using multiple images
KR20180050363A (en) Camera calibration using composite image
US20120177283A1 (en) Forming 3d models using two images
US10872432B2 (en) Disparity estimation device, disparity estimation method, and program
EP4296963A2 (en) Method for depth detection in images captured using array cameras
KR20170017586A (en) Method for assuming parameter of 3d display device and 3d display device thereof
JP2011253376A (en) Image processing device, image processing method and program
JP2014092461A (en) Image processor and image processing method, image processing system, and program
Brückner et al. Intrinsic and extrinsic active self-calibration of multi-camera systems
JP6061770B2 (en) Camera posture estimation apparatus and program thereof
JP6396499B2 (en) Scale measurement of 3D information
WO2019048904A1 (en) Combined stereoscopic and phase detection depth mapping in a dual aperture camera
US8340399B2 (en) Method for determining a depth map from images, device for determining a depth map
JP2009530701A5 (en)
JP5782766B2 (en) Image processing apparatus, image processing method, and image processing program
US20150248766A1 (en) Image processing apparatus and image processing method
Brückner et al. Active self-calibration of multi-camera systems
Mičušík et al. Omnidirectional camera model and epipolar geometry estimation by ransac with bucketing?
WO2015159791A1 (en) Distance measuring device and distance measuring method
JP5887974B2 (en) Similar image region search device, similar image region search method, and similar image region search program
JP6655869B2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141028

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141111

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150109

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150706

R151 Written notification of patent or utility model registration

Ref document number: 5782766

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees