JP2006331108A - Image processing apparatus, image processing method and program - Google Patents

Image processing apparatus, image processing method and program Download PDF

Info

Publication number
JP2006331108A
JP2006331108A JP2005154232A JP2005154232A JP2006331108A JP 2006331108 A JP2006331108 A JP 2006331108A JP 2005154232 A JP2005154232 A JP 2005154232A JP 2005154232 A JP2005154232 A JP 2005154232A JP 2006331108 A JP2006331108 A JP 2006331108A
Authority
JP
Japan
Prior art keywords
image
pixels
search
nth
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2005154232A
Other languages
Japanese (ja)
Inventor
Shuichi Utsugi
修一 宇都木
Hisashi Suzuki
寿 鈴木
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.)
Tama TLO Co Ltd
Original Assignee
Tama TLO 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 Tama TLO Co Ltd filed Critical Tama TLO Co Ltd
Priority to JP2005154232A priority Critical patent/JP2006331108A/en
Publication of JP2006331108A publication Critical patent/JP2006331108A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing apparatus, an image processing method and a program by which a highly precise matching result can be obtained in a short period of time when performing the matching operation of two images acquired from an object to be measured. <P>SOLUTION: In stereo measurement using DP matching, an area where there is no change in the luminance values of corresponding pixels between frames succeeds the route searching result of the preceding frame. An area where there is no change in the luminance values of corresponding pixels between adjacent scanning lines in one frame processing succeeds the route searching result of the just preceding scanning line. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、計測対象である物体の2次元情報を取得し、その2次元情報に基づいて、その物体の3次元情報を推定する画像処理技術に関する。   The present invention relates to an image processing technique that acquires two-dimensional information of an object to be measured and estimates three-dimensional information of the object based on the two-dimensional information.

従来から非接触で対象物体の3次元情報を取得する手法として、ステレオ計測が知られている。このステレオ計測による3次元情報取得手法は、異なる視点から対象物体の画像を取得し、各視点の位置関係と各画像の見え方の違いから対象物体の3次元情報を得るというものである。   Conventionally, stereo measurement is known as a method for acquiring three-dimensional information of a target object in a non-contact manner. This three-dimensional information acquisition method by stereo measurement acquires an image of a target object from different viewpoints, and acquires the three-dimensional information of the target object from the difference in the positional relationship between the viewpoints and the appearance of the images.

例えば、図1に示すように、平行かつ等位に置かれた複数(この場合、2つ)のカメラからの複数の画像(左画像、右画像)を取得し、その中の1つの画像、例えば左画像を基準画像とする。そして、計測対象の物体2上の点A,Bに対応する、基準画像(左画像)の座標上での位置A1,B1と、右画像の座標上での位置A2,B2との差(視差)と、視点位置と視線方向から三角測量の原理に基づいて、点A,Bまでの距離を算出する。   For example, as shown in FIG. 1, a plurality of images (left image and right image) from a plurality of (two in this case) cameras placed in parallel and at the same position are acquired, and one image among them is acquired. For example, the left image is set as the reference image. Then, the difference (parallax) between the positions A1 and B1 on the coordinates of the reference image (left image) and the positions A2 and B2 on the coordinates of the right image corresponding to the points A and B on the object 2 to be measured. ), And the distance to points A and B is calculated based on the principle of triangulation from the viewpoint position and the line-of-sight direction.

通常、ステレオ視による3次元情報の取得を行う場合、1つの基準となる画像上の点が、その他の画像上のどの点に対応しているかを対応点探索(マッチング演算)によって認識する。そして、一方の画像上にある点に対して、その対応点は、他方の画像内のある直線上に存在する。一般に、この直線をエピポーラ線(Epipolar Line)と呼ぶ。
したがって、図1に示すように、2つの同一のカメラが平行かつ等位に置かれた場合には、エピポーラ線が水平となり、水平方向の一次元探索でマッチングをとることができる。
このような水平方向の一次元探索でのマッチングを高精度に行う手法として、例えば下記非特許文献1に記載された技術が開示されている。
Usually, when acquiring three-dimensional information by stereo vision, it is recognized by corresponding point search (matching calculation) which point on the image used as one reference corresponds to which point on the other image. Then, for a point on one image, the corresponding point exists on a straight line in the other image. In general, this straight line is called an epipolar line.
Therefore, as shown in FIG. 1, when two identical cameras are placed in parallel and at the same position, the epipolar line becomes horizontal, and matching can be achieved by a one-dimensional search in the horizontal direction.
For example, a technique described in Non-Patent Document 1 below is disclosed as a technique for performing such matching in a horizontal one-dimensional search with high accuracy.

宇都木修一、鈴木寿、“高速ステレオ計測のためのDPマッチングの近似手法”、電子情報通信学会技術報告、Vol.104, No.290, pp.165-170, Sep.2004.Shuichi Utsugi and Hisashi Suzuki, “Approximation method of DP matching for high-speed stereo measurement”, IEICE technical report, Vol.104, No.290, pp.165-170, Sep.2004.

ところで、上記非特許文献1に記載された技術は、エピポーラ線上において、左画像および右画像の対応する画素間の輝度値の差分に応じたコストの累積値を最小にするように一次元探索を行う、動的計画法(DP:Dynamic Programming)を用いたマッチング(以下、DPマッチングという)を行っているため、マッチング精度に優れるものの、エピポーラ線上のほぼすべての画素に対してDPマッチング(経路探索演算)を行っているので、計算量が非常に多い。それゆえ、処理対象が動画となる場合には、実時間処理が困難である。   By the way, the technique described in the non-patent document 1 performs a one-dimensional search on the epipolar line so as to minimize the accumulated value of the cost according to the difference in luminance value between corresponding pixels of the left image and the right image. Although matching using dynamic programming (DP) (hereinafter referred to as DP matching) is performed, DP matching (path search) is performed for almost all pixels on the epipolar line, although the matching accuracy is excellent. The calculation amount is very large. Therefore, real-time processing is difficult when the processing target is a moving image.

本発明は、上述した観点によってなされたものであって、その目的は、計測対象から取得した2つの画像間のマッチング演算を行う際に、高精度のマッチング結果を短時間で得ることができる画像処理装置、画像処理方法、および、プログラムを提供することにある。   The present invention has been made in accordance with the above-described viewpoint, and an object of the present invention is to obtain an accurate matching result in a short time when performing a matching operation between two images acquired from a measurement target. A processing apparatus, an image processing method, and a program are provided.

上記課題を克服するために、本発明の第1の観点は、一定期間ごとに、物体の2次元画像として第1画像を取得する第1撮像手段と、当該第1撮像手段と水平方向に所定の距離だけ離れた場所に位置し、前記一定期間ごとに、前記物体の2次元画像として第2画像を取得する第2撮像手段と、前記第1および第2画像のエピポーラ線上に沿った画素の順で、その画素間の画素値の差分に応じたコストの累積値を最小にする前記画素間の対応付けを探索する探索手段と、前記第1または第2画像のいずれかの画像を基準画像として、当該基準画像のN番目画像(N:2以上の整数)とN−1番目画像間とで、対応する画素間の画素値の変化が基準値よりも小さい第1領域を検出する検出手段と、前記探索手段によるN−1番目画像の前記第1領域の探索結果を引き継ぐことで、前記探索手段によるN番目の探索対象領域を制限する制限手段と、を備えた画像処理装置である。   In order to overcome the above-described problems, a first aspect of the present invention provides a first imaging unit that acquires a first image as a two-dimensional image of an object at predetermined intervals, and a predetermined horizontal direction with the first imaging unit. And a second imaging means for acquiring a second image as a two-dimensional image of the object at regular intervals, and pixels along the epipolar lines of the first and second images. In order, search means for searching for an association between the pixels that minimizes a cumulative value of the cost according to a difference in pixel values between the pixels, and either the first or second image as a reference image Detection means for detecting a first region in which a change in pixel value between corresponding pixels is smaller than the reference value between the Nth image (N: integer greater than or equal to 2) of the reference image and the N−1th image. And the first area of the (N-1) th image by the search means By taking over the search results, an image processing apparatus and a limiting means for limiting the N-th search target area by said search means.

上記課題を克服するために、本発明の第2の観点は、一定期間ごとに物体の2次元画像を処理する画像処理方法であって、水平方向に所定の距離だけ離れた場所から、前記物体の2次元画像として、N−1番目(N:2以上の整数)の第1画像および第2画像を取得する第1工程と、前記N−1番目の第1および第2画像のエピポーラ線上に沿った画素の順で、その画素間の画素値の差分に応じたコストの累積値を最小にする前記画素間の対応付けを探索する第2工程と、N番目の前記第1画像および第2画像を取得する第3工程と、前記第1または第2画像のいずれかの画像を基準画像として、当該基準画像のN番目画像とN−1番目画像間とで、対応する画素間の画素値の変化が基準値よりも小さい第1領域を検出する第4工程と、N番目の第1画像および第2画像に基づいて画素間の対応付けを探索するときに、N−1番目画像の前記第1領域の探索結果を引き継ぐことで、N番目の探索対象領域を制限する第5工程と、を備えた画像処理方法である。   In order to overcome the above problems, a second aspect of the present invention is an image processing method for processing a two-dimensional image of an object at regular intervals, wherein the object is separated from a place at a predetermined distance in the horizontal direction. As a two-dimensional image, a first step of obtaining an N−1th (N: integer greater than or equal to 2) first image and a second image, and an epipolar line on the N−1th first and second images A second step of searching for an association between the pixels that minimizes a cumulative value of the cost according to a difference in pixel value between the pixels in order of the pixels along the first, second and second N images; A pixel value between corresponding pixels between the Nth image and the (N-1) th image of the reference image, with the third step of acquiring an image and using either the first or second image as a reference image A fourth step of detecting the first region in which the change in the value is smaller than the reference value; When searching for the correspondence between pixels based on the first image and the second image, the Nth search target region is limited by taking over the search result of the first region of the (N−1) th image. An image processing method comprising five steps.

上記課題を克服するために、本発明の第3の観点は、一定期間ごとに物体の2次元画像を処理する画像処理のプログラムであって、水平方向に所定の距離だけ離れた場所から、前記物体の2次元画像として取得された、N−1番目(N:2以上の整数)の第1画像および第2画像を取り込む第1手順と、前記N−1番目の第1および第2画像のエピポーラ線上に沿った画素の順で、その画素間の画素値の差分に応じたコストの累積値を最小にする前記画素間の対応付けを探索する第2手順と、N番目の前記第1画像および第2画像を取り込む第3手順と、前記第1または第2画像のいずれかの画像を基準画像として、当該基準画像のN番目画像とN−1番目画像間とで、対応する画素間の画素値の変化が基準値よりも小さい第1領域を検出する第4手順と、N番目の第1画像および第2画像に基づいて画素間の対応付けを探索するときに、N−1番目画像の前記第1領域の探索結果を引き継ぐことで、N番目の探索対象領域を制限する第5手順と、をコンピュータに実行させるプログラムである。   In order to overcome the above-described problem, a third aspect of the present invention is an image processing program for processing a two-dimensional image of an object at regular intervals, wherein the program is performed from a place that is separated by a predetermined distance in the horizontal direction. A first procedure for capturing an N−1th (N: integer greater than or equal to 2) first image and a second image acquired as a two-dimensional image of an object, and the N−1th first and second images A second procedure for searching for an association between the pixels that minimizes a cumulative value of cost according to a difference in pixel values between the pixels in the order of pixels along the epipolar line; and the Nth first image And the third procedure for capturing the second image, and using either the first image or the second image as a reference image, and between the corresponding pixels between the Nth image and the N-1st image of the reference image Detect a first region in which a change in pixel value is smaller than a reference value When searching for the correspondence between pixels based on the fourth procedure and the Nth first image and the second image, the search results of the first region of the (N−1) th image are taken over, so that the Nth A program for causing a computer to execute a fifth procedure for limiting a search target area.

本発明によれば、計測対象から取得した2つの画像間のマッチング演算を行う際に、高精度のマッチング結果を短時間で得ることが可能となる。   According to the present invention, it is possible to obtain a highly accurate matching result in a short time when performing a matching operation between two images acquired from a measurement target.

先ず、本発明と以下に述べる実施の形態との対応関係を記す。
本発明の第1撮像手段、第2撮像手段は、実施形態における左カメラ10、右カメラ20に対応する。
本発明の探索手段は、制御部31の「累積距離算出処理」および「最適経路取得処理」により実現される。
本発明の検出手段は、制御部31の「フレーム間の差分検出処理」により実現される。
本発明の第2検出手段は、制御部31の「走査線間の差分検出処理」により実現される。
本発明の制限手段は、制御部31の「フレーム間の差分検出処理」により実現される。
本発明の第2制限手段は、制御部31の「走査線間の差分検出処理」により実現される。
本発明の第3制限手段は、制御部31の「刈込み処理」により実現される。
本発明のエピポーラ線は、実施形態の説明における「走査線」に対応する。
First, the correspondence between the present invention and the embodiments described below will be described.
The first imaging unit and the second imaging unit of the present invention correspond to the left camera 10 and the right camera 20 in the embodiment.
The search means of the present invention is realized by the “cumulative distance calculation process” and the “optimum route acquisition process” of the control unit 31.
The detection means of the present invention is realized by the “difference detection process between frames” of the control unit 31.
The second detection means of the present invention is realized by the “difference detection process between scanning lines” of the control unit 31.
The limiting means of the present invention is realized by the “difference detection process between frames” of the control unit 31.
The second limiting means of the present invention is realized by the “difference detection process between scanning lines” of the control unit 31.
The third limiting means of the present invention is realized by the “pruning process” of the control unit 31.
The epipolar line of the present invention corresponds to the “scan line” in the description of the embodiment.

以下、本発明の一実施形態を添付図面に関連付けて説明する。
本発明の一実施形態である3次元形状計測装置1は、計測対象の物体の2次元画像をステレオ視カメラによって取得し、エピポーラ線上において、得られた2つの2次元画像に対してマッチング演算(対応点探索)を行う。そして、その演算結果に基づいて計測対象の物体までの距離を推定する。
実施形態に係る3次元形状計測装置1は、マッチング演算に要する処理時間を極めて短時間で行うことを特徴としている。これによって、特に、計測対象の物体が動いている場合、すなわち、動画に基づいてフレーム単位で(実時間で)マッチング演算を行う場合に効果を奏する。
Hereinafter, an embodiment of the present invention will be described with reference to the accompanying drawings.
A three-dimensional shape measurement apparatus 1 according to an embodiment of the present invention acquires a two-dimensional image of an object to be measured by a stereo vision camera, and performs a matching operation on the two obtained two-dimensional images on an epipolar line ( Perform corresponding point search). Based on the calculation result, the distance to the object to be measured is estimated.
The three-dimensional shape measurement apparatus 1 according to the embodiment is characterized in that the processing time required for the matching calculation is performed in a very short time. This is particularly effective when the object to be measured is moving, that is, when the matching calculation is performed on a frame basis (in real time) based on the moving image.

図1は、実施形態に係る3次元形状計測装置1の外観構成の一例を示す図である。
3次元形状計測装置1では、ステレオ視カメラとしての左カメラ10および右カメラ20は、全く同一のカメラであって、かつ、撮像を行う上での設定(たとえば、焦点距離、輝度調整など)は同一となっている。そして、左カメラ10および右カメラ20は、同一高さに、かつ、計測対象の物体2に向けて平行配置されている。したがって、本実施形態では、エピポーラ線が水平軸に常に平行であり、かつ、そのエピポーラ線である同一の水平ライン上で、左画像および右画像の一次元マッチング問題を想定することができる。
FIG. 1 is a diagram illustrating an example of an external configuration of a three-dimensional shape measuring apparatus 1 according to the embodiment.
In the three-dimensional shape measuring apparatus 1, the left camera 10 and the right camera 20 as stereo viewing cameras are exactly the same camera, and settings for performing imaging (for example, focal length, brightness adjustment, etc.) It is the same. The left camera 10 and the right camera 20 are arranged in parallel at the same height and toward the object 2 to be measured. Therefore, in this embodiment, the epipolar line is always parallel to the horizontal axis, and the one-dimensional matching problem of the left image and the right image can be assumed on the same horizontal line that is the epipolar line.

図2は、実施形態に係る3次元形状計測装置1のシステム構成を示すブロック図である。
図2に示すように、3次元形状計測装置1の画像処理装置30は、制御部31、画像インタフェース32、メモリ33、表示部34を含んで構成され、各部はバス35によって接続されている。
FIG. 2 is a block diagram showing a system configuration of the three-dimensional shape measuring apparatus 1 according to the embodiment.
As shown in FIG. 2, the image processing device 30 of the three-dimensional shape measuring apparatus 1 includes a control unit 31, an image interface 32, a memory 33, and a display unit 34, and each unit is connected by a bus 35.

制御部31は、マイクロコントローラを主体として含み、たとえばデータ転送制御、タイミング制御など画像処理装置30の全体の制御を統括する。
制御部31は、左カメラ10および右カメラ20に対して、同期した撮像指示信号をフレーム期間(たとえば、30フレーム/秒であれば1/30秒)ごとに送出する。これにより、左カメラ10および右カメラ20は、同時に物体2の撮像を開始する。
制御部31は、左カメラ10および右カメラ20により撮像された画像データをそのフレーム期間内に、画像インタフェース32を介して取得する。そして、1フレーム期間内に水平線を順に走査し、取得した画像データに基づいて画像処理を行う。
制御部31で行われる様々な画像処理については、後に詳述する。
The control unit 31 includes a microcontroller as a main body and supervises overall control of the image processing apparatus 30 such as data transfer control and timing control.
The control unit 31 sends a synchronized imaging instruction signal to the left camera 10 and the right camera 20 every frame period (for example, 1/30 seconds for 30 frames / second). Thereby, the left camera 10 and the right camera 20 start imaging the object 2 at the same time.
The control unit 31 acquires image data captured by the left camera 10 and the right camera 20 via the image interface 32 within the frame period. Then, the horizontal lines are sequentially scanned within one frame period, and image processing is performed based on the acquired image data.
Various image processing performed by the control unit 31 will be described in detail later.

メモリ33のRAM領域には、毎フレームごとのマッチング演算結果が格納される。後述するように、3次元形状計測装置1では、あるフレーム時点のマッチング演算を行う際に、1つ前のフレームにおけるマッチング演算結果を使用するため、少なくとも1フレーム期間、メモリ33にマッチング演算結果を保持しておく。
また、後述するように、3次元形状計測装置1では、あるフレーム期間内の1走査線(エピポーラ線)に対するマッチング演算を行う際に、1つ前の走査線におけるマッチング演算結果を使用するため、少なくとも1走査期間、メモリ33にマッチング演算結果を保持しておく。
In the RAM area of the memory 33, a matching calculation result for each frame is stored. As will be described later, in the three-dimensional shape measurement apparatus 1, when performing the matching calculation at a certain frame time, the matching calculation result in the previous frame is used, so the matching calculation result is stored in the memory 33 for at least one frame period. Keep it.
Further, as will be described later, in the three-dimensional shape measurement apparatus 1, when performing a matching operation on one scanning line (epipolar line) within a certain frame period, the matching calculation result on the previous scanning line is used. The matching calculation result is held in the memory 33 for at least one scanning period.

次に、制御部31で行われる画像処理について、以下の順序で説明する。
なお、以下の複数の処理は、(*1)DPマッチングを用いた3次元計測に必須の処理、(*2)DPマッチングの高速化のための処理、に大別できる。
Next, image processing performed by the control unit 31 will be described in the following order.
The following plurality of processes can be broadly divided into (* 1) processes essential for three-dimensional measurement using DP matching and (* 2) processes for speeding up DP matching.

[画像データの取り込み](*1)
[水平線の抽出処理](*1)
[特徴点の抽出処理](*2)
[輝度距離算出処理](*1)
[累積距離算出処理](*1)
[刈込み処理](*2)
[最適経路取得処理](*1)
[物体までの距離算出処理](*1)
[フレーム間の差分検出処理](*2)
[走査線間の差分検出処理](*2)
[Import image data] (* 1)
[Horizontal line extraction processing] (* 1)
[Feature point extraction processing] (* 2)
[Luminance distance calculation processing] (* 1)
[Cumulative distance calculation processing] (* 1)
[Pruning process] (* 2)
[Optimum route acquisition processing] (* 1)
[Distance calculation processing to the object] (* 1)
[Difference detection between frames] (* 2)
[Difference detection processing between scanning lines] (* 2)

[画像データの取り込み]
画像処理装置30では、左カメラ10および右カメラ20により生成された画像データをフレーム期間ごとに取り込む。
図3は、一例として略立方体の物体2に対して、左カメラ10および右カメラ20がそれぞれ撮像・生成した画像の一例であって、(a)は左画像、(b)は右画像を示す。取り込まれた画像は、たとえば左画像を基準画像として、フレーム期間内に以降の処理が行われる。
[Import image data]
The image processing apparatus 30 captures image data generated by the left camera 10 and the right camera 20 for each frame period.
FIGS. 3A and 3B are examples of images captured and generated by the left camera 10 and the right camera 20, respectively, with respect to the substantially cubic object 2, where FIG. 3A shows a left image and FIG. 3B shows a right image. . The captured image is subjected to subsequent processing within the frame period, for example, using the left image as a reference image.

なお、以降の処理の説明のために、取り込んだ画像について、以下のように定義する。すなわち、左画像(基準画像)の水平位置をi、画像の幅をIとし、右画像の水平位置をj、画像の幅をJとする。また、双方の画像において垂直位置をh、画像の高さをHとする。さらに、t番目フレームの左画像上の座標(i,h)における画素の輝度値をe(i,h,t)、t番目フレームの右画像上の座標(j,h)における画素の輝度値をe(j,h,t)とする。 For the explanation of the subsequent processing, the captured image is defined as follows. That is, the horizontal position of the left image (reference image) is i, the width of the image is I, the horizontal position of the right image is j, and the width of the image is J. In both images, the vertical position is h, and the image height is H. Further, the luminance value of the pixel at the coordinates (i, h) on the left image of the t-th frame is represented by e L (i, h, t), and the luminance value of the pixel at the coordinates (j, h) on the right image of the t-th frame. Let e R (j, h, t) be the value.

[水平線の抽出処理]
水平線の抽出処理では、エピポーラ線としての走査線(高さh)に対して、左画像および右画像から、走査線を中心とする幅2η+1本の水平線(走査線自体も含む)を抜き出す処理を行う。
DPマッチング演算では、走査線を下方から上方へ順にシフトさせ、異なる高さの走査線ごとに幅2η+1本の水平線を抽出して、以下の処理を行う。各走査線に対して抽出された幅2η+1本の水平線は、後述する輝度距離の算出に用いられる。
[Horizontal line extraction]
In the horizontal line extraction process, a process of extracting 2η + 1 horizontal lines (including the scan line itself) centered on the scan line from the left image and the right image with respect to the scan line (height h) as an epipolar line. Do.
In the DP matching calculation, the scanning lines are sequentially shifted from the bottom to the top, 2η + 1 horizontal lines are extracted for each scanning line having a different height, and the following processing is performed. The 2η + 1 width horizontal lines extracted for each scanning line are used for calculation of the luminance distance described later.

[特徴点の抽出処理]
特徴点の抽出処理では、左画像と右画像の相関を精度良くかつ高速に行うために、計測対象である物体2の特徴位置(特徴点)を、走査線ごとに抽出する。隣接する画素の輝度値の差が大きい位置で、物体の輪郭など物体2の外形上の特徴を示すことから、本処理では、基準画像である左画像の走査線上のすべての画素において、隣接する左(または右)の画素との輝度値の差分を算出し、この差分が一定の閾値以上であることを条件として、特徴点の抽出を行う。すなわち、画像上のエッジを画素単位で検出して、これを特徴点とする。
その際、走査線の両端点については、特徴点の対象としない。また、特徴点を多く算出し過ぎると、精度が維持できなくなるため、輝度値の差分が大きいものから数えて、所定のN個の点までを特徴点とする。また、高速化の妨げとなるため、隣接する特徴点が所定の閾値以上の間隔となるように、特徴点を抽出する。
特徴点の抽出結果は、刈込み処理、走査線間差分検出処理、フレーム間差分検出処理において探索範囲を絞り込むために利用される。
[Feature point extraction]
In the feature point extraction processing, the feature position (feature point) of the object 2 to be measured is extracted for each scanning line in order to accurately and rapidly correlate the left image and the right image. Since the feature of the outer shape of the object 2 such as the contour of the object is shown at a position where the difference in luminance value between adjacent pixels is large, in this processing, all the pixels on the scanning line of the left image that is the reference image are adjacent to each other. A difference in luminance value with the left (or right) pixel is calculated, and feature points are extracted on the condition that the difference is equal to or greater than a certain threshold. That is, an edge on the image is detected in units of pixels, and this is used as a feature point.
At this time, the end points of the scanning line are not subject to feature points. If too many feature points are calculated, the accuracy cannot be maintained. Therefore, up to a predetermined number of N points are counted from the largest difference in luminance value. In addition, since the speed is hindered, the feature points are extracted so that the adjacent feature points have an interval equal to or larger than a predetermined threshold.
The feature point extraction result is used to narrow down the search range in the pruning process, the inter-scan line difference detection process, and the inter-frame difference detection process.

図4は、ある走査線上において、画像の水平軸と輝度値の差分との関係を図解した図である。図4において、Nは、たとえばユーザにより予め設定された特徴点の数、iintは、特徴点同士の最小間隔を規定する閾値、を示す。 FIG. 4 is a diagram illustrating the relationship between the horizontal axis of an image and the difference in luminance value on a certain scanning line. In FIG. 4, N is the number of feature points preset by the user, for example, and i int is a threshold value that defines the minimum interval between feature points.

実際の処理では、この特徴点の数Nと閾値iintに基づいて、制御部31では、以下のように特徴点を抽出する。
すなわち、走査線上のすべての画素について、それぞれ隣接する画素との輝度値の差分を計算し、計算した輝度値の差分を大きい順に、その画素の位置と関連付けてメモリ33に保存する。
次に、差分の順位が2番目以降の画素について、その上位にあるすべての画素(n位の画素は1位の画素からn−1位までのすべての画素)との位置の差を計算する。位置の差がiintより小さいものが1つでもあった場合は、その画素を除外する。除外されずに残った上位N個の点を特徴点とする。
ここで、以降の処理の説明のため、画像の左端からn番目の特徴点のiの値をiと定義する。
In actual processing, based on the number N of feature points and the threshold value i int , the control unit 31 extracts feature points as follows.
That is, for all the pixels on the scanning line, the difference in luminance value with the adjacent pixel is calculated, and the calculated difference in luminance value is stored in the memory 33 in association with the position of the pixel in descending order.
Next, with respect to the second and subsequent pixels of the difference order, the difference in position with all the higher-order pixels (the n-th pixel is all the pixels from the first pixel to the (n-1) -th pixel) is calculated. . If there is at least one position difference smaller than i int , that pixel is excluded. The top N points remaining without being excluded are taken as feature points.
Here, for the explanation of the subsequent processing, the value of i of the nth feature point from the left end of the image is defined as in.

図5は、上述した特徴点抽出処理の一例を図解する図である。
たとえば、走査線上のすべての画素について、輝度値の差分を計算し、計算した輝度値の差分を大きい順に並べた結果が図5に例示した結果であり、かつ、予め、N=5およびiint=20が与えられていた場合を想定する。
かかる場合には、順位3のi:256の画素については、これよりも上位の順位2のi:245の画素と比較して、位置の差分が閾値iint(=20)よりも小さいため、削除される。同様に、順位4のi:12の画素については、これよりも上位の順位1のi:10の画素と比較して、位置の差分が閾値iint(=20)よりも小さいため、削除される。
このようにして、図5に示す例では、位置:567,178,413の画素の順位が繰り上がって、5個の特徴点が抽出される。
FIG. 5 is a diagram illustrating an example of the feature point extraction process described above.
For example, the result of calculating the luminance value difference for all the pixels on the scanning line and arranging the calculated luminance value difference in descending order is the result illustrated in FIG. 5, and N = 5 and i int in advance. Assume that = 20 is given.
In such a case, since the i: 256 pixel in the rank 3 is smaller than the threshold i int (= 20) in comparison with the i: 245 pixel in the rank 2 higher than this, Deleted. Similarly, the i: 12 pixel in the rank 4 is deleted because the position difference is smaller than the threshold i int (= 20) as compared with the i: 10 pixel in the rank 1 higher than this. The
In this manner, in the example shown in FIG. 5, the order of the pixels at the positions: 567, 178, and 413 is advanced, and five feature points are extracted.

[輝度距離算出処理]
輝度距離算出処理は、次処理の累積距離算出処理において逐次実行される。
輝度距離とは、左画像(基準画像)上のある垂直ライン上に存在する複数の画素と、右画像上のある垂直ライン上に存在する複数の画素とに対して、水平ラインごとに対応する画素同士の輝度の距離を、以下の式(1)に示すようにユークリッド距離として定義したものである。この輝度距離が、DP演算において最適解に対するコストに相当する。
この輝度距離は、[水平線の抽出処理]で抽出された2η+1本の水平線による範囲(水平位置:h−η〜h+ηの範囲)において算出する。
[Luminance distance calculation processing]
The luminance distance calculation process is sequentially executed in the cumulative distance calculation process of the next process.
The luminance distance corresponds to a plurality of pixels existing on a certain vertical line on the left image (reference image) and a plurality of pixels existing on a certain vertical line on the right image for each horizontal line. The luminance distance between pixels is defined as the Euclidean distance as shown in the following formula (1). This luminance distance corresponds to the cost for the optimal solution in the DP calculation.
This luminance distance is calculated in the range of 2η + 1 horizontal lines extracted in [Horizontal line extraction processing] (horizontal position: range of h−η to h + η).

なお、式(1)において、i≧jのときd(i,j)=∞(コンピュータで計算させる場合には、一般的に輝度距離がとり得る値と比較して十分に大きな値)とする。また、d(i,0)=0,d(I−1,j)=0とする。   In equation (1), when i ≧ j, d (i, j) = ∞ (a sufficiently large value as compared with a value that can generally be taken by the luminance distance when calculated by a computer). . Also, d (i, 0) = 0 and d (I-1, j) = 0.

図6は、輝度距離の算出例を図解する図である。
図6では、8つの水平線に対して、左画像の画素と、対応する右画像の画素に対して上記(1)式が演算され、特定のi,jに対し、輝度距離d(i,j)として「6」が算出されている。
FIG. 6 is a diagram illustrating an example of calculating the luminance distance.
In FIG. 6, the above equation (1) is calculated for the pixels of the left image and the corresponding pixels of the right image for eight horizontal lines, and the luminance distance d (i, j ) Is calculated as “6”.

[累積距離算出処理]
本実施形態に係る3次元形状計測装置1では、走査線上において、左画像(基準画像)に対する右画像のマッチング演算を高精度に行うため、コストとしての輝度距離が最小となるようなDPマッチング演算を用いる。
本実施形態では、走査線がエピポーラ線となっているので、走査線上における左画像と右画像の画素間を対応付けを、走査線上に沿って輝度距離を累積した累積距離が最小となるような経路を探索することにより決定する。この経路探索は、(i,j)が(0,0)から(I−1,J−1)までの範囲で、かつ、jが増加する方向に探索する。
[Cumulative distance calculation processing]
In the three-dimensional shape measuring apparatus 1 according to the present embodiment, the DP matching calculation that minimizes the luminance distance as the cost is performed on the scanning line in order to perform the matching calculation of the right image with respect to the left image (reference image) with high accuracy. Is used.
In this embodiment, since the scanning line is an epipolar line, the left and right pixels on the scanning line are associated with each other, and the cumulative distance obtained by accumulating the luminance distance along the scanning line is minimized. Decide by searching the route. In this route search, (i, j) is searched in the range from (0, 0) to (I-1, J-1), and j increases.

具体的に、累積距離は、(i,j)を(0,0)から(I−1,J−1)まで、i>jの範囲に対し、下記式(2)に示すように算出する。
なお、下記式(2)において、i≧jまたはi<0またはj<0のとき、D(i,j)=∞(コンピュータで計算させる場合には、一般的に累積距離がとり得る値と比較して十分に大きな値)とする。また、D(0,0)=0とする。
Specifically, the cumulative distance is calculated from (0, 0) to (I-1, J-1) from (0, 0) to the range of i> j as shown in the following formula (2). .
In the following formula (2), when i ≧ j or i <0 or j <0, D (i, j) = ∞ (in the case of calculation by a computer, generally a value that the cumulative distance can take and A sufficiently large value). Further, it is assumed that D (0,0) = 0.

式(2)において、λは、(i−1,j−1)から(i,j)へ経路を探索する際のチューニングパラメータである。すなわち、(i−1,j−1)から(i,j)への経路は、斜め方向である点で隣接画素間の経路と異なるため、アプリケーションに応じてλを変更することで、画素間の対応付けを調整できるようにしている。   In Expression (2), λ is a tuning parameter when searching for a route from (i−1, j−1) to (i, j). That is, since the path from (i−1, j−1) to (i, j) is different from the path between adjacent pixels in that it is in an oblique direction, by changing λ according to the application, the path between pixels Can be adjusted.

図7は、累積距離の算出例を図解する図である。
図7に示すように、探索処理において、(i,j)に達するには3つの経路、すなわち、(i−1,j)→(i,j),(i−1,j−1)→(i,j),(i,j−1)→(i,j)の経路があり得る。そして、水平位置(i,j)の累積距離D(i,j)を求める際には、式(2)に従って上記3つの経路の中でどの経路を選択したかをメモリ33に逐次記憶しておく。たとえば、経路を記憶しておく配列をkとして、(i,j−1)から(i,j)への経路を採用した場合は、k(i,j)=(i,j−1)を配列kに書き込む。
FIG. 7 is a diagram illustrating an example of calculating the cumulative distance.
As shown in FIG. 7, in the search process, three routes to reach (i, j), that is, (i−1, j) → (i, j), (i−1, j−1) → There can be a path of (i, j), (i, j-1) → (i, j). Then, when obtaining the cumulative distance D (i, j) of the horizontal position (i, j), the memory 33 sequentially stores which of the three routes has been selected according to the equation (2). deep. For example, when an array for storing paths is k and a path from (i, j-1) to (i, j) is adopted, k (i, j) = (i, j-1) is set. Write to array k.

図7に示した例では、(i,j−1)における累積距離D(i,j−1):13に対して、(i,j−1)〜(i,j)間の輝度距離d(i,j):32を加えた累積距離D(i,j):45が3つの経路の中で最小になるため、(i,j−1)→(i,j)の経路が採用される。そして、配列kに対して、「k(i,j)=(i,j−1)」が書き込まれる。   In the example shown in FIG. 7, the luminance distance d between (i, j-1) to (i, j) with respect to the cumulative distance D (i, j-1): 13 at (i, j-1). Since the cumulative distance D (i, j): 45 plus (i, j): 32 is the smallest among the three routes, the route (i, j-1) → (i, j) is adopted. The Then, “k (i, j) = (i, j−1)” is written to the array k.

[刈込み処理]
刈込み処理は、すでに算出しておいた特徴点を用いて、上述した経路探索を高精度かつ高速に行うための処理である。刈込み処理は、経路探索中に特徴点iに到達したときに、実行され、(i,j)領域において経路探索を行う必要がない領域を特定する。
[Pruning process]
The pruning process is a process for performing the above-described route search with high accuracy and high speed using the feature points that have already been calculated. Pruning process, when reaching the feature point i n in the path search is performed to identify the (i, j) is not necessary to perform the route search in the region area.

具体的には、経路の探索(i,jを変化させながら累積距離D(i,j)の逐次計算)中に、i=i(i:n番目の特徴点)達した場合には、i=iである全ての画素について、累積距離D(i,j)を計算し、その累積距離D(i,j)をi+jで除算する。そして、その除算結果が最も小さくなるjをjとする。すなわち、下記の式(3)が成立するjをjとする。
なお、累積距離D(i,j)をi+jで除算するのは、(0,0)から(i,j)までの距離に応じてjの決定が影響を受けないように、正規化するためである。
Specifically, when i = i n (i n : nth feature point) is reached during the route search (sequential calculation of the cumulative distance D (i, j) while changing i, j). , for all pixels is i = i n, to calculate the cumulative distance D (i n, j), dividing the cumulative distance D (i n, j) at i n + j. Then, the division result is the smallest j and j n. That is, j for which the following formula (3) is established is j n .
Note that the cumulative distance D (i n , j) is divided by i n + j so that the determination of j n is not affected by the distance from (0,0) to (i n , j). To normalize.

ただし、j−1=0。
However, j −1 = 0.

そして、jを算出した後の経路探索(i>iの範囲の探索)では、j<jとなる範囲の探索を行わない。すなわち、特徴点における対応位置(i,j)のマッチング精度は十分に高いと判断でき、累積距離がD(i,j)よりも大きくなる範囲、すなわちjより小さいjの範囲は探索する必要がないので行わない。
図8は、刈込み処理を図解した図であるが、上記(3)式の結果が最小となる位置(i,j)が決定された後、i>iの範囲の経路探索では、図の「刈込み領域」(j<jとなる範囲)を処理対象としない。
In the route search after calculating j n (searching for a range of i> i n ), searching for a range where j <j n is not performed. That is, it can be determined that the matching accuracy of the corresponding position (i n , j n ) at the feature point is sufficiently high, and the range in which the cumulative distance is larger than D (i n , j), that is, the range of j smaller than j n is Don't do it because you don't have to search.
Figure 8 is a diagram illustrating the pruning process, equation (3) the result is the minimum position (i n, j n) after is determined, the route search in the range of i> i n, The “pruning area” in the figure (the range where j <j n ) is not processed.

[最適経路取得処理]
以上のようにして、刈込み処理を行って探索範囲を絞り込みながら、経路探索を行う。
図9は、探索結果の一例を図解した図であるが、図に示すように、特徴点において特定された「刈込み領域」を探索対象から除去しながら、i>jの範囲で経路(図9において太い矢印で示す。)を探索する。すなわち、(i,j)を(0,0)から(I−1,J−1)までの累積距離D(i,j)を逐次求めていくことにより、累積距離D(I−1,J−1)を最小にする経路を算出する。
この最小にする経路は、たとえば下記の式(4)が示す形で、経路を決定するごとにメモリ33内の配列kに順次書き込まれるため、式(4)において矢印で示すように、この配列kを逆に辿ることで、走査線上における、左画像および右画像の画素間のマッチング結果が得られる。
[Optimum route acquisition processing]
As described above, the route search is performed while narrowing down the search range by performing the trimming process.
FIG. 9 is a diagram illustrating an example of the search result. As shown in FIG. 9, while removing the “pruning region” specified in the feature point from the search target, the route (i.e., FIG. 9 (Indicated by a thick arrow). That is, the cumulative distance D (I-1, J) is obtained by sequentially obtaining the cumulative distance D (i, j) from (0, 0) to (I-1, J-1) for (i, j). Calculate the path that minimizes -1).
The path to be minimized is written in the array k in the memory 33 every time a path is determined, for example, in the form shown by the following expression (4). Therefore, as shown by the arrow in the expression (4), this array By tracing k backward, a matching result between the pixels of the left image and the right image on the scanning line can be obtained.

[物体までの距離算出処理]
以上のDPマッチング演算により、左画像と右画像の水平位置の対応付けがなされたため、三角測量の原理により、計測対象である物体2までの距離を算出することができる。
たとえば、左画像上の点iが右画像上の点jに対応しているとすると、左カメラ10〜右カメラ20間の距離b、両カメラの焦点から撮像面までの距離ρを用いて、下記の式(5)に従って物体2までの距離disを算出する。そして、式(5)の演算をすべての(i,j)について行うことで、走査線上における物体2までの距離を推定することができる。
以上の処理をすべての走査線に対して行うことで、1フレームにおける物体2の3次元形状を推定することができる。
[Calculation of distance to object]
Since the horizontal position of the left image and the right image is associated by the above DP matching calculation, the distance to the object 2 as the measurement target can be calculated by the principle of triangulation.
For example, if the point i 0 on the left image corresponds to the point j 0 on the right image, the distance b between the left camera 10 and the right camera 20 and the distance ρ from the focal point of both cameras to the imaging surface are used. Then, the distance dis to the object 2 is calculated according to the following equation (5). And the distance to the object 2 on a scanning line can be estimated by performing the calculation of Formula (5) about all (i, j).
By performing the above processing on all the scanning lines, the three-dimensional shape of the object 2 in one frame can be estimated.

[フレーム間の差分検出処理]
上述した[画像データの取り込み]〜[物体までの距離算出処理]の処理は、1フレームにおいて得られた画像データに基づいて行われる処理であり、以上の処理がフレームごとに順次行われる。
そこで、物体2が動く場合、すなわち左画像および右画像が動画像である場合を想定する。かかる場合、ある画像領域においてフレームごとに変化がない(または小さい)ことがあるため、フレーム間の画像の差分を検出することで、前のフレームの計算結果(経路探索結果)を流用できる可能性がある。
したがって、本実施形態に係る3次元形状計測装置1では、フレーム間の差分(輝度差分)を検出することにより、フレームごとの計算量を削減し、実時間処理に適したDPマッチング処理を行う。
[Difference detection between frames]
The above-described processing of [image data capture] to [object distance calculation processing] is processing performed based on image data obtained in one frame, and the above processing is sequentially performed for each frame.
Therefore, it is assumed that the object 2 moves, that is, the left image and the right image are moving images. In such a case, there is a case where there is no change (or small) for each frame in a certain image region. Therefore, there is a possibility that the calculation result (path search result) of the previous frame can be diverted by detecting the image difference between frames. There is.
Therefore, in the three-dimensional shape measurement apparatus 1 according to the present embodiment, the amount of calculation for each frame is reduced by detecting a difference between frames (luminance difference), and DP matching processing suitable for real-time processing is performed.

つまり、各フレームにおいてDPマッチング演算を行う前に、前回のフレームと現在のフレームにおける同一位置の画素の輝度値の差分を求め、この差分が小さいと判断した画像領域については、現在のフレームにおけるDPマッチング演算を行わず、当該画像領域については前回のフレームにおける演算結果を流用する。
なお、画素の輝度値の差分演算は、一方の画像、たとえば左画像(基準画像)のみについて行えばよい。
That is, before performing the DP matching calculation in each frame, the difference between the luminance values of the pixels at the same position in the previous frame and the current frame is obtained. The matching calculation is not performed, and the calculation result in the previous frame is used for the image area.
Note that the pixel luminance value difference calculation may be performed only for one image, for example, the left image (reference image).

輝度値に変化があったか否かについての判断は、以下のように行う。
先ず、あらかじめ画素の輝度値の差分の閾値ethと、閾値ethを越えた画素の数に対する閾値Sthを設定しておき、特徴点間の区間ごとに、t番目フレームと(t−1)番目フレーム(前回のフレーム)の画素の輝度値の差分が閾値ethを越えた画素の数をカウントする。
すなわち、t番目フレームにおいて左画像上の座標(i,h)の輝度差分値が閾値ethを越えたか否かを示す値をδ(i,h,t)(1:閾値ethを越えた、0:閾値ethを越えない)、特徴点位置(垂直軸位置)iから次の特徴点位置in+1までの区間内に、輝度差分値が閾値ethを越えた画素の数をSとすると、δ(i,h,t)およびSは、それぞれ、下記の式(6)および(7)に示すように算出される。
The determination as to whether or not the luminance value has changed is made as follows.
First, a threshold value e th of a difference in luminance values of pixels and a threshold value S th for the number of pixels exceeding the threshold value e th are set in advance, and the t-th frame and (t−1) are set for each section between feature points. ) Count the number of pixels in which the difference in luminance value of the pixels of the frame (previous frame) exceeds the threshold eth .
That is, a value indicating whether the luminance difference value of the coordinates (i, h) on the left image exceeds the threshold value eth in the t-th frame is represented by δ F (i, h, t) (1: exceeding the threshold value eth ). and, 0: threshold e th not exceeding), feature point position (in vertical axis position) in the interval from i n to the next feature point position i n + 1, the number of pixels whose luminance difference value exceeds the threshold value e th Assuming S F , δ F (i, h, t) and S F are calculated as shown in the following equations (6) and (7), respectively.

次に、カウント対象区間内において式(7)によって算出されたSと、所定の閾値Sth(個)とを比較し、Sが閾値Sthよりも多い場合、その区間では画素の輝度値の変化を検出したと判断する。逆に、Sが閾値Sthよりも少ない場合、その区間では画素の輝度値の変化を検出しなかったと判断する。 Then, the S F calculated by the formula (7) in the counted within the interval, compared with a predetermined threshold value S th (number), if S F is greater than the threshold S th, the luminance at the section pixel It is determined that a change in value has been detected. Conversely, if S F is less than the threshold S th, in the section is determined to not detect the change in luminance value of the pixel.

上述した処理を具体例に基づいてさらに説明する。
図10は、フレーム間の差分検出処理の一例を図解する図であって、(a)は(t−1)番目フレームにおける、ある区間の複数の画素の輝度値、(b)はt番目フレームにおける、同一区間の複数の画素の輝度値、(c)は(t−1)番目フレーム〜t番目フレーム間の輝度差分、をそれぞれ示す。
図10に例示した区間は、t番目フレームにおいて抽出された3つの特徴点によって、図に示すように4つの区間a1〜a4に分割され、分割された区間ごとに、上述した画素の輝度値の変化を検出する。
The processing described above will be further described based on a specific example.
FIG. 10 is a diagram illustrating an example of a difference detection process between frames, where (a) is a luminance value of a plurality of pixels in a certain section in the (t−1) th frame, and (b) is a tth frame. , (C) shows the luminance difference between the (t−1) th frame and the tth frame, respectively.
The section illustrated in FIG. 10 is divided into four sections a1 to a4 as shown in the figure by the three feature points extracted in the t-th frame. For each divided section, the luminance value of the pixel described above is divided. Detect changes.

図10に示す例において、仮に閾値ethを「1.5」、閾値Sthを「3」に設定すると、区間a1およびa2は、輝度差分がいずれも閾値ethより小さいので、S=0となる。したがって、区間a1およびa2では、画素の変化がないと判断され、この区間では、(t−1)番目フレームの経路探索結果を流用(継承)する。区間a3では、いずれの閾値も越えるため、画素の輝度値の変化があると判断され、この区間では、t番目フレームにおいて再度経路探索処理(再計算)を行う。区間a4では、閾値ethを越える画素の数が1つのみであり、閾値Sthを越えないため、(t−1)番目フレームの経路探索結果を流用(継承)する。
このように、閾値ethを越える画素の数を、処理対象区間における画素の輝度値の変化の判断に加えることで、フレーム間の誤差を排除しつつ、再計算領域を制限する(狭める)ことができる。
In the example illustrated in FIG. 10, if the threshold value eth is set to “1.5” and the threshold value Sth is set to “3”, the luminance difference in the sections a1 and a2 is smaller than the threshold value eth , so that S F = 0. Accordingly, it is determined that there is no pixel change in the sections a1 and a2, and the route search result of the (t−1) -th frame is used (inherited) in this section. In the section a3, since any threshold is exceeded, it is determined that there is a change in the luminance value of the pixel. In this section, the route search process (recalculation) is performed again in the t-th frame. In section a4, the number only one pixel exceeding the threshold value e th, since not exceed the threshold S th, diverting route search result of (t-1) -th frame (inherited).
In this way, by adding the number of pixels exceeding the threshold eth to the determination of the change in the luminance value of the pixel in the processing target section, it is possible to limit (narrow) the recalculation area while eliminating errors between frames. Can do.

なお、画素の輝度値変化が検出された区間が複数連続する場合には、その複数の区間を1つの区間にまとめる。同様に、画素の変化が検出されなかった区間が複数連続する場合にも、その複数の区間を1つの区間にまとめる。
たとえば、図10に示した例では、画素の輝度値変化が検出されなかった区間a1およびa2は、1つの区間にまとめられる。
In addition, when a plurality of sections in which a change in luminance value of the pixel is detected continue, the plurality of sections are combined into one section. Similarly, when a plurality of sections in which no pixel change is detected continue, the plurality of sections are combined into one section.
For example, in the example illustrated in FIG. 10, the sections a1 and a2 in which no change in the luminance value of the pixel is detected are combined into one section.

図11は、(i,j)領域において、新しいフレームにおいて経路を再計算する再計算領域と、前のフレームの経路を継承する継承領域とを図解した図である。
あるフレームにおいて特徴点を抽出した後に、図11に示すように、画素の輝度値変化が検出された区間は、「再計算領域」としてまとめられ、また、画素の輝度値変化が検出されなかった区間は、「承継領域」としてまとめられる。そして、そのフレームでは、図11に示す点Aから点Bまでの経路のみが探索される。
FIG. 11 is a diagram illustrating a recalculation area for recalculating a path in a new frame and an inheritance area that inherits the path of the previous frame in the (i, j) area.
After extracting the feature points in a certain frame, as shown in FIG. 11, the sections in which the change in the luminance value of the pixel is detected are collected as a “recalculation area”, and the change in the luminance value of the pixel is not detected. Sections are summarized as “inherited areas”. In that frame, only the route from point A to point B shown in FIG. 11 is searched.

図12は、再計算領域における計算結果と、継承領域における計算結果(前のフレームから流用された結果)との間の処理を図解した図である。
たとえば(t−1)番目フレームでの計算結果(マッチング結果)は、少なくとも1フレーム期間の間メモリ33に保持される。そして、t番目フレームの処理において継承領域が確定されると、その継承領域の計算結果がメモリ33から取り出される。なお、(t−1)番目フレームでの計算結果は、図12に示すように、配列kの形で(前述の式(4)参照)メモリ33に格納されている。
そして、t番目フレームでの計算結果(マッチング結果)を算出して、t番目フレームにおける配列kの値が決定すると、図11に矢印で示すように、配列kを逆に辿ることで、t番目フレームにおいて、(0,0)から(I−1,J−1)までの(i,j)のマッチング結果が得られる。
以上説明した処理が走査線ごとに行われ、走査線上の対応する画素間でのマッチング演算対象領域が狭められる。
FIG. 12 is a diagram illustrating processing between the calculation result in the recalculation area and the calculation result in the inheritance area (results diverted from the previous frame).
For example, the calculation result (matching result) in the (t−1) th frame is held in the memory 33 for at least one frame period. When the inheritance area is determined in the processing of the t-th frame, the calculation result of the inheritance area is retrieved from the memory 33. Note that the calculation result in the (t−1) -th frame is stored in the memory 33 in the form of an array k (see the above equation (4)), as shown in FIG.
When the calculation result (matching result) in the t-th frame is calculated and the value of the array k in the t-th frame is determined, as shown by the arrow in FIG. In the frame, a matching result of (i, j) from (0, 0) to (I-1, J-1) is obtained.
The processing described above is performed for each scanning line, and the matching calculation target area between corresponding pixels on the scanning line is narrowed.

このようにして、本実施形態に係る3次元形状計測装置1では、フレーム間の差分(輝度差分)を検出することにより、フレームごとの計算量を削減し、実時間処理に適したDPマッチング処理を行う。   In this way, in the three-dimensional shape measuring apparatus 1 according to the present embodiment, DP matching processing suitable for real-time processing is achieved by reducing the amount of calculation for each frame by detecting a difference (luminance difference) between frames. I do.

[走査線間の差分検出処理]
フレーム間の輝度差分に応じて計算量を削減する処理と同様に、走査線間の輝度差分に応じて、[画像データの取り込み]〜[物体までの距離算出処理]に要する計算量を削減することができる。
すなわち、あるフレームにおいて、隣接する走査線の画素の輝度値変化がない(または小さい)ことがあるため、走査線間の画素の輝度差分を検出することで、すでに計算が済んだ走査線の計算結果(経路探索結果)を次の計算対象の走査線に対して流用できる可能性がある。つまり、上述した[フレーム間の差分検出処理]における再計算領域について、さらに計算領域を制限できる(狭めることができる)余地がある。
かかる観点から、本実施形態に係る3次元形状計測装置1では、走査線間の差分(輝度差分)を検出することにより、1フレームにおける計算量を削減し、実時間処理に適したDPマッチング処理を行う。なお、隣接する走査線間の輝度値の差分演算は、一方の画像、たとえば左画像(基準画像)のみについて行えばよい。
[Difference detection processing between scanning lines]
Similar to the processing for reducing the amount of calculation according to the luminance difference between frames, the amount of calculation required for [image data capture] to [object distance calculation processing] is reduced according to the luminance difference between scanning lines. be able to.
That is, since there may be no change (or small) in the luminance value of the pixels of the adjacent scanning line in a certain frame, the calculation of the scanning line that has already been calculated by detecting the luminance difference of the pixel between the scanning lines. There is a possibility that the result (path search result) can be used for the next scan line to be calculated. That is, there is room for further limitation (narrowing) of the calculation area for the recalculation area in the above-described [difference detection processing between frames].
From this point of view, in the three-dimensional shape measurement apparatus 1 according to the present embodiment, the DP matching process suitable for real-time processing is achieved by detecting the difference (brightness difference) between the scanning lines to reduce the amount of calculation in one frame. I do. Note that the luminance value difference calculation between adjacent scanning lines may be performed only for one image, for example, the left image (reference image).

以下、走査線間の差分検出処理の具体的処理について、図13を参照して説明する。
図13において、再計算領域RA1は、上述した[フレーム間の差分検出処理]によって限定された再計算領域(区間aq+1の領域)であり、左下端点が(i,j)、右上端点が(iq+1,jq+1)である。
先ず、すでに計算が終了している、高さ(h−1)の走査線(1ライン下の走査線)における経路が、再計算領域RA1の左下端点(i,j)および右上端点(iq+1,jq+1)を通過しているか否かを確認する。そして、通過していない場合は、高さhの走査線に対しては、再計算領域RA1の全領域を対象として、経路探索を行う。
Hereinafter, specific processing of difference detection processing between scanning lines will be described with reference to FIG.
In FIG. 13, the recalculation area RA1 is a recalculation area (area a q + 1 ) limited by the above-described “difference detection process between frames”, the lower left end point is (i q , j q ), and the upper right end point. Is (i q + 1 , j q + 1 ).
First, the path on the scanning line of height (h−1) (one scanning line below) that has already been calculated is the lower left end point (i q , j q ) and upper right end point ( i q + 1 , j q + 1 ) is checked. If not, the route search is performed for the entire area of the recalculation area RA1 for the scanning line having the height h.

一方、高さ(h−1)の走査線における経路が、高さhの走査線における再計算領域RA1の両端点を通過している場合には、以下の処理を行う。
先ず、あらかじめ画素の輝度値の差分の閾値ethと、閾値ethを越えた画素の数に対する閾値Sthを設定しておく。区間aq+1内に存在する特徴点のうち、区間aq+1の左端から数えてζ個目の特徴点のiの値をiζとしたときに、iζとiζ+1を両端とする区間(特徴点間の区間)に対して、高さhの走査線と高さ(h−1)の走査線間で、対応する画素の輝度値の差分が閾値ethを越えた画素の数をカウントする。
すなわち、高さhの走査線における左画像上の座標(i,h)の輝度差分値が閾値ethを越えたか否かを示す値をδ(i,h,t)(1:閾値ethを越えた、0:閾値ethを越えない)、特徴点位置iζから次の特徴点位置iζ+1までの区間内に、輝度差分値が閾値ethを越えた画素の数をSとすると、δ(i,h,t)およびSは、それぞれ、下記の式(8)および(9)に示すようにして算出される。
On the other hand, when the path on the scanning line having the height (h−1) passes through both end points of the recalculation area RA1 on the scanning line having the height h, the following processing is performed.
First, a threshold value eth for the difference in luminance value of pixels and a threshold value Sth for the number of pixels exceeding the threshold value eth are set in advance. Of the feature points that exist in the interval a q + 1, section a q + 1 of the value of i of zeta numbered from the left end th feature point is taken as i zeta, i zeta and i zeta + 1 a section that both ends (wherein For the interval between points), the number of pixels in which the difference in luminance value of the corresponding pixel exceeds the threshold value eth between the scanning line with height h and the scanning line with height (h-1) is counted. .
That is, a value indicating whether or not the luminance difference value of the coordinates (i, h) on the left image in the scanning line of height h exceeds the threshold value eth is represented by δ L (i, h, t) (1: threshold value e th exceeds 0, not exceeding the threshold e th ), and the number of pixels whose luminance difference value exceeds the threshold e th within the section from the feature point position i ζ to the next feature point position i ζ + 1 is expressed as S L Then, δ L (i, h, t) and S L are calculated as shown in the following equations (8) and (9), respectively.

次に、カウント対象区間内において式(9)によって算出されたSと、所定の閾値Sth個とを比較し、Sが閾値Sthよりも多い場合、その区間では画素の輝度値変化が検出されたと判断する。逆に、Sが閾値Sthよりも少ない場合、その区間では画素の輝度値変化が検出されなかったと判断する。
このように、閾値ethを越える画素の数を、処理対象区間における画素の輝度値変化の判断に加えることで、走査線間の誤差を排除しつつ、再計算領域をさらに制限する(狭める)ことができる。
Next, S L calculated by the equation (9) in the count target section is compared with a predetermined threshold value S th , and when S L is larger than the threshold value S th , the luminance value change of the pixel in the section Is detected. Conversely, if S L is less than the threshold value S th , it is determined that no change in the luminance value of the pixel has been detected in that interval.
In this way, by adding the number of pixels exceeding the threshold eth to the determination of the change in luminance value of the pixels in the processing target section, it is possible to further limit (narrow) the recalculation area while eliminating errors between scanning lines. be able to.

なお、画素の輝度値変化が検出された区間が複数連続する場合には、その複数の区間を1つの区間にまとめる。同様に、画素の輝度値変化が検出されなかった区間が複数連続する場合にも、その複数の区間を1つの区間にまとめる。
たとえば、図13では、画素の輝度値変化が検出された区間によって、再計算領域RA1をさらに限定した、左下端点(i,j)および右上端点(ip+1,jp+1)を有する再計算領域RA2が生成される。
このように、本実施形態に係る3次元形状計測装置1では、図13において、(i,j)から(ip+1,jp+1)までの累積距離D(i,j)に基づいて経路探索を行うだけでよい。そして、フレーム間の差分検出処理と同様に(図12と示したのと同様に)、走査線間の承継領域に対しては、すでに行われた(一つ下の)走査線におけるマッチング結果を流用することで、大幅に計算量が削減される。
In addition, when a plurality of sections in which a change in luminance value of the pixel is detected continue, the plurality of sections are combined into one section. Similarly, when a plurality of sections in which no change in the luminance value of the pixel is detected continue, the plurality of sections are combined into one section.
For example, in FIG. 13, the recalculation having the lower left end point (i p , j p ) and the upper right end point (i p + 1 , j p + 1 ) further restricting the recalculation area RA1 by the interval in which the change in the luminance value of the pixel is detected. Region RA2 is generated.
Thus, in the three-dimensional shape measuring apparatus 1 according to this embodiment, in FIG. 13, based on (i p, j p) from (i p + 1, j p + 1) to the cumulative distance D (i, j) paths Just search. Then, as in the difference detection process between frames (similar to that shown in FIG. 12), for the inherited region between the scan lines, the matching result in the scan line already performed (one lower) is displayed. By diverting, the amount of calculation is greatly reduced.

以上、制御部31で行われる画像処理について説明した。次に、3次元形状計測装置1の動作について、図14〜17に示すフローチャートを参照して説明する。   The image processing performed by the control unit 31 has been described above. Next, the operation of the three-dimensional shape measuring apparatus 1 will be described with reference to the flowcharts shown in FIGS.

図14〜図17に示すフローチャートは、1フレーム期間に処理されるべき、3次元形状計測装置1の処理内容を示す。
先ず、図14において、3次元形状計測装置1は、1フレーム期間ごとに左カメラ10および右カメラ20から画像データを取り込む(ステップST1)。
本実施形態では、取り込んだ画像から、走査線を中心とする幅2η+1本の水平線を抜き出す。したがって、走査線hは、ηを初期値として、η〜H−η(H:画像の高さ)の範囲で順に上方にシフトされ、走査線ごとに左右画像のマッチング処理を行う(ステップST2、ST3)。
ある走査線hを定めると、その走査線を中心とする幅2η+1本の水平線が両画像から抽出され(ステップST4)、基準画像である左画像において、走査線h上の特徴点の抽出(輝度によるエッジ検出)が行われる(ステップST5)。
The flowchart shown in FIGS. 14-17 shows the processing content of the three-dimensional shape measuring apparatus 1 which should be processed in 1 frame period.
First, in FIG. 14, the three-dimensional shape measuring apparatus 1 takes in image data from the left camera 10 and the right camera 20 every frame period (step ST1).
In the present embodiment, 2η + 1 horizontal lines centered on the scanning line are extracted from the captured image. Accordingly, the scanning line h is shifted upward in order within a range of η to H−η (H: image height) with η as an initial value, and right and left image matching processing is performed for each scanning line (step ST2, ST3).
When a certain scanning line h is defined, 2η + 1 horizontal lines centered on the scanning line are extracted from both images (step ST4), and feature points on the scanning line h are extracted (luminance) in the left image as the reference image. Edge detection) is performed (step ST5).

次に、DPマッチング演算を特徴点間の区間ごとに行う。なお、Nは予め設定された特徴点の数であり、pは、特徴点の区間ごとにDPマッチング演算が終了するとインクリメントされる変数である(ステップST6、ST7)。但し、本実施形態に係る3次元形状計測装置1では、DPマッチング演算による経路探索を行う前に、処理対象フレームにおける計算対象の画像領域を制限する。
すなわち、最初に処理されるフレームであるか否か判別し(ステップST8)、最初に処理されるフレームでなければ、前回のフレームと今回のフレームとで、対応する画素同士の輝度値を比較して、フレーム間で画素の輝度変化があるか否かが判別され(ステップST9、ST10)、輝度変化がないと判定されれば前回のフレームにおける計算結果の継承処理が行われる(ステップST11)。これにより、再計算領域と継承領域が特定され、再計算領域のみ経路探索が行われる。
Next, DP matching calculation is performed for each section between feature points. Note that N is a preset number of feature points, and p is a variable that is incremented when the DP matching calculation is completed for each feature point section (steps ST6 and ST7). However, in the three-dimensional shape measuring apparatus 1 according to the present embodiment, the image area to be calculated in the processing target frame is limited before performing the route search by the DP matching calculation.
That is, it is determined whether or not it is the first frame to be processed (step ST8). If it is not the first frame to be processed, the luminance values of corresponding pixels are compared in the previous frame and the current frame. Thus, it is determined whether or not there is a change in the luminance of the pixel between the frames (steps ST9 and ST10). If it is determined that there is no change in the luminance, the inheritance process of the calculation result in the previous frame is performed (step ST11). Thereby, the recalculation area and the inheritance area are specified, and the route search is performed only in the recalculation area.

一方、フレーム間で輝度変化があると判定された場合には、その輝度変化があった再計算領域を特定し、その再計算領域において、走査線間の輝度変化に応じて、特定された再計算領域をさらに制限できないか(狭められないか)について判断する処理を行う。
この場合には、先ず、処理される走査線が最も下に位置する(高さη)走査線であるか否かを判別する(ステップ13)。最も下に位置する走査線ではない場合には、特定された再計算領域の端点を、1つ前の走査線(高さ(h−1)の走査線)において算出された経路が通過するか否かを判別し(ステップST14)、通過しない場合には、ステップST9において特定された再計算領域のすべてについて経路探索を行う。
1つ前の走査線において算出された経路が再計算領域の端点を通過する場合には、対応する画素間の輝度差分に基づいて、走査線間の差分検出を行う(ステップST15)。そして、走査線間の差分が基準値よりも小さいと判断される(ステップST16)と、1つ前の走査線において算出された経路が、次の走査線における経路として継承される(ステップST17)。輝度変化が大きいと判断される(ステップST16)と、ステップST15において特定された再計算領域のすべてについて経路探索を行う。
また、最も下に位置する走査線であった場合にはステップST15において特定された再計算領域のすべてについて経路探索を行う。
On the other hand, if it is determined that there is a luminance change between frames, the recalculation area where the luminance change has occurred is specified, and the recalculation area specified in the recalculation area is determined according to the luminance change between the scanning lines. Processing is performed to determine whether the calculation area cannot be further restricted (cannot be narrowed).
In this case, it is first determined whether or not the scanning line to be processed is the lowest (height η) scanning line (step 13). If it is not the lowest scanning line, does the path calculated in the previous scanning line (the scanning line of height (h-1)) pass through the end point of the specified recalculation area? If it does not pass, the route search is performed for all of the recalculation areas specified in step ST9.
When the path calculated in the previous scanning line passes through the end point of the recalculation area, the difference between the scanning lines is detected based on the luminance difference between the corresponding pixels (step ST15). When it is determined that the difference between the scanning lines is smaller than the reference value (step ST16), the path calculated in the previous scanning line is inherited as the path in the next scanning line (step ST17). . If it is determined that the luminance change is large (step ST16), a route search is performed for all of the recalculation areas specified in step ST15.
If the scanning line is located at the lowest position, the route search is performed for all the recalculation areas specified in step ST15.

一方、最初に処理されるフレームであった場合には、そのフレーム内において、走査線間の輝度変化に応じて、特定された再計算領域をさらに制限できないか(狭められないか)について判断する処理を行う。
この場合には、先ず、処理される走査線が最も下に位置する(高さη)走査線であるか否かを判別する(ステップST12)。最も下に位置する走査線ではない場合には、対応する画素間の輝度差分に基づいて、走査線間の差分検出を行う(ステップST15)。そして、走査線間の差分が基準値よりも小さいと判断される(ステップST16)と、1つ前の走査線において算出された経路が、次の走査線における経路として継承される(ステップST17)。輝度変化が大きいと判断される(ステップST16)と、ステップST15において特定された再計算領域のすべてについて経路探索を行う。また、最も下に位置する走査線であった場合には走査線全体について経路探索を行う。
On the other hand, if it is the first frame to be processed, it is determined whether or not the specified recalculation area can be further limited (cannot be narrowed) in accordance with the luminance change between the scanning lines in the frame. Process.
In this case, first, it is determined whether or not the scanning line to be processed is the lowest (height η) scanning line (step ST12). If it is not the lowest scanning line, the difference between the scanning lines is detected based on the luminance difference between the corresponding pixels (step ST15). When it is determined that the difference between the scanning lines is smaller than the reference value (step ST16), the path calculated in the previous scanning line is inherited as the path in the next scanning line (step ST17). . If it is determined that the luminance change is large (step ST16), a route search is performed for all of the recalculation areas specified in step ST15. If the scanning line is located at the lowest position, a route search is performed for the entire scanning line.

以上のフレーム間差分検出および走査線間差分検出によって、最終的に再計算領域が特定されると、図16以降に示すステップST18〜ST31において、DPマッチング演算(経路探索)が行われる。
DPマッチング演算は、基準画像(左画像)の水平位置iが、たとえばi〜ip+1の範囲で(ステップST18、19)、かつ、右画像の水平位置jがjからj<iを満たす範囲で行われる(ステップST20、21)。
DPマッチング演算では、走査線上の左画像および右画像の画素間のコストとして輝度距離を算出し(ステップST22)、累積距離が最小となる経路を順に探索する(ステップST23)。
そして、図17において、基準画像(左画像)の水平位置iが、ステップST5で抽出した特徴点iと一致すると(ステップST26)、その特徴点iが区間の開始位置iでないことを条件として、刈込み処理を行う(ステップST28)。これにより、さらに経路探索領域を制限する。
1つの刈込み処理が終了すると、次の刈込み処理のために、ステップST30でnがインクリメントされ、ステップST26において次の特徴点iと水平位置iとの一致判断がなされる。
When the recalculation area is finally specified by the above-described interframe difference detection and scanning line difference detection, DP matching calculation (path search) is performed in steps ST18 to ST31 shown in FIG.
In the DP matching calculation, the horizontal position i of the reference image (left image) is, for example, in a range of i p to i p + 1 (steps ST18 and ST19), and the horizontal position j of the right image satisfies j <i from j n. The range is performed (steps ST20 and ST21).
In the DP matching calculation, the luminance distance is calculated as the cost between the pixels of the left image and the right image on the scanning line (step ST22), and a route having the minimum cumulative distance is searched in order (step ST23).
Then, 17, the horizontal position i of the reference image (left image) and matches the feature point i n extracted in step ST5 (step ST26), that the feature point i n is not the start position i p of the sections As a condition, a trimming process is performed (step ST28). This further restricts the route search area.
If one pruning process is completed for the next mowing process, n is incremented at step ST30, consistency determination to the next feature point i n a horizontal position i is made in step ST26.

以上のようにして、走査線上の1つの区間におけるDPマッチング演算を行った後は、メモリ33に格納された配列kを逆に辿ることで、最適経路を取得し(ステップST32)、pをインクリメントして(ステップST33)、同一走査線上の次の区間における処理をステップST8に戻って行う。
走査線上のすべての区間の最適経路が算出されると、その走査線における左右画像の水平位置が対応付けられたことになるので、三角測量の原理によって、計測対象までの距離を算出し(ステップST35)、1つ上の走査線の処理に移行する(ステップST36)。
After performing DP matching calculation in one section on the scanning line as described above, the optimal path is acquired by tracing back the array k stored in the memory 33 (step ST32), and p is incremented. Then (step ST33), the processing in the next section on the same scanning line is performed by returning to step ST8.
When the optimum paths for all the sections on the scanning line are calculated, the horizontal positions of the left and right images on the scanning line are associated with each other. Therefore, the distance to the measurement target is calculated based on the principle of triangulation (step (ST35) The process proceeds to the processing of the scanning line one level higher (step ST36).

以上説明したように、本実施形態に係る3次元形状計測装置1によれば、計測対象である物体2の2次元画像として、左画像と右画像を取得し、走査線ごとにDPマッチング演算によって左画像および右画像の水平位置を特定する際に、フレーム間差分検出処理、走査線間差分検出処理、および刈込み処理を行うため、各フレームにおいて計算対象(経路探索対象)とする画像領域を極小化できる。
したがって、計測対象である物体2が大きく動く場合等、動画処理を伴う場合でも、実時間処理が十分に可能となる。
さらに、マッチング精度が高いDPマッチング演算を基本としているため、マッチング処理における高精度化と高速化を高い次元で両立することが可能となる。
なお、上述したフレーム間差分検出処理、走査線間差分検出処理、および刈込み処理は、すべて実行されることが実時間処理の観点から好ましいが、各処理は相互に依存性を持たないので、それぞれ独立に実行することもできる。
As described above, according to the three-dimensional shape measurement apparatus 1 according to the present embodiment, the left image and the right image are acquired as the two-dimensional image of the object 2 to be measured, and the DP matching calculation is performed for each scanning line. When specifying the horizontal position of the left image and the right image, the image area to be calculated (path search target) is minimized in each frame in order to perform inter-frame difference detection processing, inter-scan line difference detection processing, and pruning processing. Can be
Therefore, real-time processing is sufficiently possible even when moving image processing is involved, such as when the object 2 to be measured moves greatly.
Furthermore, since the DP matching calculation with high matching accuracy is the basis, it is possible to achieve both high accuracy and high speed in matching processing at a high level.
Note that the inter-frame difference detection process, the inter-scan line difference detection process, and the pruning process described above are preferably executed from the viewpoint of real-time processing, but each process has no dependency on each other. It can also be run independently.

次に、本実施形態に係る3次元形状計測装置1の定量的な効果の一例について述べる。
図18は、実施形態に係る3次元形状計測装置1の効果を測定するためのサンプル画像であって、(a)は計測対象の左画像、(b)は計測対象の右画像、をそれぞれ示す。実際には、図18に示す画像は動画像であり、矢印で示すチェック柄の立方体が画像の右の方向に向かって10[mm/flame]の速度で移動している。なお、画像のサイズは640[pixel]×480[pixel]である。
Next, an example of a quantitative effect of the three-dimensional shape measuring apparatus 1 according to the present embodiment will be described.
18A and 18B are sample images for measuring the effect of the three-dimensional shape measuring apparatus 1 according to the embodiment, where FIG. 18A shows a left image of the measurement target, and FIG. 18B shows a right image of the measurement target. . In practice, the image shown in FIG. 18 is a moving image, and a check pattern cube indicated by an arrow moves at a speed of 10 mm / frame toward the right side of the image. The size of the image is 640 [pixel] × 480 [pixel].

図19は、図18に示したサンプル動画像に対する特徴点の数と計算時間との関係を示す図である。図19における計算時間は、1フレームのステレオ計測処理にかかる計算時間の平均値である。
図20は、図18に示したサンプル動画像において、計測精度の違いを表した図である。図20では、特徴点を変化させたときの相対誤差の平均値の変化を表している。
図19および図20において、ケースIは、フレーム間の差分検出処理および走査線間の差分検出処理を行わない場合の結果を、ケースIIは、フレーム間の差分検出処理および走査線間の差分検出処理を行った場合の結果を、それぞれ示す。
FIG. 19 is a diagram showing the relationship between the number of feature points and calculation time for the sample moving image shown in FIG. The calculation time in FIG. 19 is an average value of the calculation time for one frame of stereo measurement processing.
FIG. 20 is a diagram showing a difference in measurement accuracy in the sample moving image shown in FIG. FIG. 20 shows a change in the average value of the relative error when the feature point is changed.
19 and 20, Case I shows the result when the difference detection process between frames and the difference detection process between the scanning lines are not performed, and Case II shows the difference detection process between the frames and the difference detection between the scanning lines. The results when processing is performed are shown respectively.

図19において、たとえば、特徴点の数が20個のときの計算時間は、ケースIでは約14[s]であるが、ケースIIでは、約2[s]まで短縮され、ケースIと比較すると、約1/7の計算時間となっている。また、特徴点の数が0個のときは、DPマッチングに対する高速化を一切おこなわないが、このとき計算時間は約70[s]である。すなわち、ケースIIでは、特徴点の数が20個の場合には、特徴点の数が0個のときと比較して、計算時間は約1/35にもなる。   In FIG. 19, for example, the calculation time when the number of feature points is 20 is about 14 [s] in case I, but is shortened to about 2 [s] in case II. The calculation time is about 1/7. When the number of feature points is 0, the DP matching is not accelerated at all, but the calculation time is about 70 [s]. That is, in case II, when the number of feature points is 20, the calculation time is about 1/35 compared to when the number of feature points is zero.

図20において、特徴点の数が0個の場合がDPマッチングにおける最適解であり、このときの相対誤差は3.9[%]であった。特徴点の数が19個のときには、ケースIとケースIIとの相対誤差の差が最大となり、ケースIでは約4.3[%]であったのに対し、ケースIIでは5.9[%]であった。すなわち、ケースI〜ケースII間で計測精度に大きな変化は見られないことがわかる。   In FIG. 20, the case where the number of feature points is 0 is the optimal solution in DP matching, and the relative error at this time was 3.9 [%]. When the number of feature points is 19, the difference in relative error between Case I and Case II is the largest, which was about 4.3 [%] in Case I, but 5.9 [%] in Case II. ]Met. That is, it can be seen that there is no significant change in measurement accuracy between Case I and Case II.

以上説明したように、フレーム間の差分検出処理および走査線間の差分検出処理を行った場合には、行わない場合と比較して、計測精度をほぼ維持したまま、計算時間を1/7〜1/8程度に短縮するという顕著な効果を得ることができる。   As described above, when the difference detection process between frames and the difference detection process between scanning lines are performed, the calculation time is reduced to 1/7 to approximately while maintaining the measurement accuracy as compared with the case where the difference detection process is not performed. A remarkable effect of shortening to about 1/8 can be obtained.

なお、本発明の実施形態は、上述した実施形態に拘泥せず、当業者であれば、本発明の要旨を変更しない範囲内で様々な改変が可能である。
たとえば、上述の実施形態では、画素の画素値の指標として「輝度」を用いたが、これに限られず、たとえば「色差」を用いてもよい。
また、上述した実施形態の説明で述べた、制御部31で実行される複数の処理は、コンピュータに実行させるプログラムによって、ソフトウエアとして実現することもできる。
The embodiments of the present invention are not limited to the above-described embodiments, and those skilled in the art can make various modifications without departing from the scope of the present invention.
For example, in the above-described embodiment, “luminance” is used as an index of the pixel value of the pixel, but the present invention is not limited to this, and for example, “color difference” may be used.
In addition, the plurality of processes executed by the control unit 31 described in the above description of the embodiment can be realized as software by a program executed by a computer.

本発明は、物体の3次元形状を認識するための用途、たとえば以下の用途に利用できる。
(1)セキュリティ分野
本発明は、顔画像認識(歩行者、侵入者の顔の認識等)へ応用できる。
(2)ITS分野
本発明は、走行中の自動車から他の走行車両に対する車間距離の計測など、自動車などの移動物体の形状計測に利用できる。
(3)ロボットビジョン
本発明は、自律移動ロボットの静止障害物および移動障害物に対するセンサとして利用できる。
The present invention can be used for applications for recognizing the three-dimensional shape of an object, for example, the following applications.
(1) Security Field The present invention can be applied to face image recognition (such as pedestrian and intruder face recognition).
(2) ITS Field The present invention can be used for measuring the shape of a moving object such as an automobile, such as measurement of the distance between a running automobile and another running vehicle.
(3) Robot Vision The present invention can be used as a sensor for stationary obstacles and moving obstacles of an autonomous mobile robot.

実施形態に係る3次元形状計測装置の外観構成の一例を示す図である。It is a figure which shows an example of the external appearance structure of the three-dimensional shape measuring apparatus which concerns on embodiment. 実施形態に係る3次元形状計測装置のシステム構成を示すブロック図である。It is a block diagram which shows the system configuration | structure of the three-dimensional shape measuring apparatus which concerns on embodiment. 計測対象の物体に対して、左カメラおよび右カメラがそれぞれ撮像・生成した左画像および右画像を例示する図である。It is a figure which illustrates the left image and right image which the left camera and the right camera imaged and produced | generated with respect to the measurement object, respectively. ある走査線上において、画像の水平軸と輝度値の差分との関係を図解した図である。It is the figure which illustrated the relationship between the horizontal axis of an image, and the difference of a luminance value on a certain scanning line. 特徴点抽出処理の一例を図解する図である。It is a figure illustrating an example of a feature point extraction process. 輝度距離の算出例を図解する図である。It is a figure illustrating the example of calculation of a luminance distance. 累積距離の算出例を図解する図である。It is a figure illustrating the example of calculation of cumulative distance. 刈込み処理を図解した図である。It is the figure which illustrated the pruning process. 探索結果の一例を図解した図である。It is the figure which illustrated an example of the search result. フレーム間の差分検出処理の一例を図解する図である。It is a figure illustrating an example of the difference detection process between frames. 新しいフレームにおいて経路を再計算する再計算領域と、前のフレームの経路を継承する継承領域とを図解した図である。It is the figure which illustrated the recalculation area | region which recalculates a path | route in a new frame, and the inheritance area | region which inherits the path | route of the previous frame. 再計算領域における計算結果と、継承領域における計算結果との間の処理を図解した図である。It is the figure which illustrated the process between the calculation result in a recalculation area | region, and the calculation result in an inheritance area | region. 走査線間の差分検出処理の具体的処理を説明するための図である。It is a figure for demonstrating the specific process of the difference detection process between scanning lines. 実施形態に係る3次元形状計測装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the three-dimensional shape measuring apparatus which concerns on embodiment. 実施形態に係る3次元形状計測装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the three-dimensional shape measuring apparatus which concerns on embodiment. 実施形態に係る3次元形状計測装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the three-dimensional shape measuring apparatus which concerns on embodiment. 実施形態に係る3次元形状計測装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the three-dimensional shape measuring apparatus which concerns on embodiment. 実施形態に係る3次元形状計測装置の効果を測定するためのサンプル動画像を表示する図である。It is a figure which displays the sample moving image for measuring the effect of the three-dimensional shape measuring apparatus which concerns on embodiment. サンプル動画像に対する特徴点の数と計算時間との関係を示す図である。It is a figure which shows the relationship between the number of the feature points with respect to a sample moving image, and calculation time. サンプル動画像に対する計測精度を表した図である。It is a figure showing the measurement precision with respect to a sample moving image.

符号の説明Explanation of symbols

1…3次元形状計測装置
10…左カメラ
20…右カメラ
30…画像処理装置
31…制御部
32…画像インタフェース
33…メモリ
34…表示部
35…バス
2…物体
DESCRIPTION OF SYMBOLS 1 ... Three-dimensional shape measuring device 10 ... Left camera 20 ... Right camera 30 ... Image processing device 31 ... Control part 32 ... Image interface 33 ... Memory 34 ... Display part 35 ... Bus 2 ... Object

Claims (7)

一定期間ごとに、物体の2次元画像として第1画像を取得する第1撮像手段と、
当該第1撮像手段と水平方向に所定の距離だけ離れた場所に位置し、前記一定期間ごとに、前記物体の2次元画像として第2画像を取得する第2撮像手段と、
前記第1および第2画像のエピポーラ線上に沿った画素の順で、その画素間の画素値の差分に応じたコストの累積値を最小にする前記画素間の対応付けを探索する探索手段と、
前記第1または第2画像のいずれかの画像を基準画像として、当該基準画像のN番目画像(N:2以上の整数)とN−1番目画像間とで、対応する画素間の画素値の変化が基準値よりも小さい第1領域を検出する検出手段と、
前記探索手段によるN−1番目画像の前記第1領域の探索結果を引き継ぐことで、前記探索手段によるN番目の探索対象領域を制限する制限手段と、
を備えた画像処理装置。
First imaging means for acquiring a first image as a two-dimensional image of the object at regular intervals;
A second imaging means that is located at a predetermined distance in the horizontal direction from the first imaging means, and obtains a second image as a two-dimensional image of the object for each predetermined period;
Search means for searching for an association between the pixels that minimizes a cumulative value of cost according to a difference in pixel values between the pixels in the order of the pixels along the epipolar lines of the first and second images;
Using either the first image or the second image as a reference image, the pixel value between corresponding pixels between the Nth image (N: integer greater than or equal to 2) and the (N-1) th image of the reference image. Detecting means for detecting a first region whose change is smaller than a reference value;
Limiting means for limiting the Nth search target area by the search means by taking over the search result of the first area of the N-1st image by the search means;
An image processing apparatus.
N番目の基準画像において、隣接するエピポーラ線上の画素間の画素値の変化が基準値よりも小さい第2領域を検出する第2検出手段と、
前記第2領域では、隣接するエピポーラ線の間で探索結果を引き継ぐことで、前記探索手段によるN番目画像の探索対象領域を制限する第2制限手段と、
をさらに備えた請求項1記載の画像処理装置。
Second detection means for detecting a second region in which a change in pixel value between pixels on adjacent epipolar lines is smaller than the reference value in the Nth reference image;
In the second region, a second restriction unit that restricts a search target region of the Nth image by the search unit by taking over a search result between adjacent epipolar lines;
The image processing apparatus according to claim 1, further comprising:
エピポーラ線上における前記基準画像のエッジを画素単位で検出するエッジ検出部と、
当該エッジ検出位置において対応付けられた画素の位置に応じて、前記探索手段による、それ以降の探索対象領域を制限する第3制限手段と、
をさらに備えた請求項1または2記載の画像処理装置。
請求項1または2記載の画像処理装置。
An edge detection unit for detecting an edge of the reference image on an epipolar line in units of pixels;
A third restriction unit for restricting a subsequent search target area by the search unit according to the position of the pixel associated with the edge detection position;
The image processing apparatus according to claim 1, further comprising:
The image processing apparatus according to claim 1.
一定期間ごとに物体の2次元画像を処理する画像処理方法であって、
水平方向に所定の距離だけ離れた場所から、前記物体の2次元画像として、N−1番目(N:2以上の整数)の第1画像および第2画像を取得する第1工程と、
前記N−1番目の第1および第2画像のエピポーラ線上に沿った画素の順で、その画素間の画素値の差分に応じたコストの累積値を最小にする前記画素間の対応付けを探索する第2工程と、
N番目の前記第1画像および第2画像を取得する第3工程と、
前記第1または第2画像のいずれかの画像を基準画像として、当該基準画像のN番目画像とN−1番目画像間とで、対応する画素間の画素値の変化が基準値よりも小さい第1領域を検出する第4工程と、
N番目の第1画像および第2画像に基づいて画素間の対応付けを探索するときに、N−1番目画像の前記第1領域の探索結果を引き継ぐことで、N番目の探索対象領域を制限する第5工程と、
を備えた画像処理方法。
An image processing method for processing a two-dimensional image of an object at regular intervals,
A first step of acquiring an N−1th (N: integer greater than or equal to 2) first image and a second image as a two-dimensional image of the object from a location separated by a predetermined distance in the horizontal direction;
Search for correspondence between pixels in order of pixels along the epipolar line of the (N-1) th first and second images in order to minimize the cumulative value of cost according to the difference in pixel value between the pixels. A second step of
A third step of obtaining the Nth first and second images;
Using either the first image or the second image as a reference image, a change in pixel value between corresponding pixels between the Nth image and the (N−1) th image of the reference image is smaller than the reference value. A fourth step of detecting one region;
When searching for correspondence between pixels based on the Nth first image and the second image, the search result of the first region of the (N-1) th image is taken over, thereby limiting the Nth search target region. And a fifth step to
An image processing method comprising:
前記第2工程は、
N番目の基準画像において、隣接するエピポーラ線上の画素間の画素値の変化が基準値よりも小さい第2領域を検出する第6工程と、
前記第2領域では、隣接するエピポーラ線の間で探索結果を引き継ぐことで、前記探索手段によるN番目画像の探索対象領域を制限する第7工程と、
をさらに備えた請求項4記載の画像処理方法。
The second step includes
A sixth step of detecting a second region in which a change in pixel value between pixels on adjacent epipolar lines is smaller than the reference value in the Nth reference image;
In the second region, the seventh step of limiting the search target region of the Nth image by the search means by taking over search results between adjacent epipolar lines;
The image processing method according to claim 4, further comprising:
一定期間ごとに物体の2次元画像を処理する画像処理のプログラムであって、
水平方向に所定の距離だけ離れた場所から、前記物体の2次元画像として取得された、N−1番目(N:2以上の整数)の第1画像および第2画像を取り込む第1手順と、
前記N−1番目の第1および第2画像のエピポーラ線上に沿った画素の順で、その画素間の画素値の差分に応じたコストの累積値を最小にする前記画素間の対応付けを探索する第2手順と、
N番目の前記第1画像および第2画像を取り込む第3手順と、
前記第1または第2画像のいずれかの画像を基準画像として、当該基準画像のN番目画像とN−1番目画像間とで、対応する画素間の画素値の変化が基準値よりも小さい第1領域を検出する第4手順と、
N番目の第1画像および第2画像に基づいて画素間の対応付けを探索するときに、N−1番目画像の前記第1領域の探索結果を引き継ぐことで、N番目の探索対象領域を制限する第5手順と、
をコンピュータに実行させるプログラム。
An image processing program for processing a two-dimensional image of an object at regular intervals,
A first procedure for capturing an N−1th (N: integer greater than or equal to 2) first image and a second image acquired as a two-dimensional image of the object from a location separated by a predetermined distance in the horizontal direction;
Search for correspondence between pixels in order of pixels along the epipolar line of the (N-1) th first and second images in order to minimize the cumulative value of cost according to the difference in pixel value between the pixels. A second procedure to
A third procedure for capturing the Nth first image and second image;
Using either the first image or the second image as a reference image, a change in pixel value between corresponding pixels between the Nth image and the (N−1) th image of the reference image is smaller than the reference value. A fourth procedure for detecting one region;
When searching for correspondence between pixels based on the Nth first image and the second image, the search result of the first region of the (N-1) th image is taken over, thereby limiting the Nth search target region. And a fifth procedure
A program that causes a computer to execute.
前記第2手順は、
N番目の基準画像において、隣接するエピポーラ線上の画素間の画素値の変化が基準値よりも小さい第2領域を検出する第6手順と、
前記第2領域では、隣接するエピポーラ線の間で探索結果を引き継ぐことで、前記探索手段によるN番目画像の探索対象領域を制限する第7手順と、
をさらに備えた請求項6記載のプログラム。
The second procedure includes
A sixth procedure for detecting a second region in which a change in pixel value between pixels on adjacent epipolar lines is smaller than a reference value in the Nth reference image;
In the second region, a seventh procedure for limiting the search target region of the Nth image by the search means by taking over search results between adjacent epipolar lines;
The program according to claim 6, further comprising:
JP2005154232A 2005-05-26 2005-05-26 Image processing apparatus, image processing method and program Pending JP2006331108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005154232A JP2006331108A (en) 2005-05-26 2005-05-26 Image processing apparatus, image processing method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005154232A JP2006331108A (en) 2005-05-26 2005-05-26 Image processing apparatus, image processing method and program

Publications (1)

Publication Number Publication Date
JP2006331108A true JP2006331108A (en) 2006-12-07

Family

ID=37552729

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005154232A Pending JP2006331108A (en) 2005-05-26 2005-05-26 Image processing apparatus, image processing method and program

Country Status (1)

Country Link
JP (1) JP2006331108A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009041403A1 (en) * 2007-09-28 2009-04-02 Hitachi Software Engineering Co., Ltd. Motionlessness deciding method and device for photograph object
JP2011053025A (en) * 2009-08-31 2011-03-17 Nissan Motor Co Ltd Distance measuring device and method of measuring distance
JP2011252835A (en) * 2010-06-03 2011-12-15 Myuu Skynet:Kk Three dimensional shape measuring device
EP2466544A1 (en) 2010-12-15 2012-06-20 Canon Kabushiki Kaisha Image processing apparatus, image processing method thereof, program and computer-readable storage medium
JP2012177608A (en) * 2011-02-25 2012-09-13 Honda Motor Co Ltd Step edge estimation device
JP2013120083A (en) * 2011-12-06 2013-06-17 Honda Motor Co Ltd Environment recognition apparatus
CN108986407A (en) * 2018-08-23 2018-12-11 浙江理工大学 A kind of safety monitoring system and method for old solitary people
US10480934B2 (en) 2017-12-27 2019-11-19 Fujitsu Limited Effective search for a silhouette cone to reconstruct a three dimensional shape of an object

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009041403A1 (en) * 2007-09-28 2009-04-02 Hitachi Software Engineering Co., Ltd. Motionlessness deciding method and device for photograph object
JP2009088801A (en) * 2007-09-28 2009-04-23 Hitachi Software Eng Co Ltd Motionlessness deciding method and device for photograph object
JP2011053025A (en) * 2009-08-31 2011-03-17 Nissan Motor Co Ltd Distance measuring device and method of measuring distance
JP2011252835A (en) * 2010-06-03 2011-12-15 Myuu Skynet:Kk Three dimensional shape measuring device
EP2466544A1 (en) 2010-12-15 2012-06-20 Canon Kabushiki Kaisha Image processing apparatus, image processing method thereof, program and computer-readable storage medium
US8699797B2 (en) 2010-12-15 2014-04-15 Canon Kabushiki Kaisha Image processing apparatus, image processing method thereof, and computer-readable storage medium
JP2012177608A (en) * 2011-02-25 2012-09-13 Honda Motor Co Ltd Step edge estimation device
JP2013120083A (en) * 2011-12-06 2013-06-17 Honda Motor Co Ltd Environment recognition apparatus
US8896689B2 (en) 2011-12-06 2014-11-25 Honda Motor Co., Ltd. Environment recognition apparatus
US10480934B2 (en) 2017-12-27 2019-11-19 Fujitsu Limited Effective search for a silhouette cone to reconstruct a three dimensional shape of an object
CN108986407A (en) * 2018-08-23 2018-12-11 浙江理工大学 A kind of safety monitoring system and method for old solitary people

Similar Documents

Publication Publication Date Title
KR101870902B1 (en) Image processing apparatus and image processing method
JP4809291B2 (en) Measuring device and program
JP2006331108A (en) Image processing apparatus, image processing method and program
JP4963964B2 (en) Object detection device
JP6030617B2 (en) Image processing apparatus and image processing method
US20110158540A1 (en) Pattern recognition method and pattern recognition apparatus
CN109766796B (en) Deep pedestrian detection method for dense crowd
JP2008113071A (en) Automatic tracking device
CN109559324A (en) A kind of objective contour detection method in linear array images
CN102833486A (en) Method and device for real-time adjusting face display scale in video image
JP2019114103A (en) Object recognition processing device, object recognition processing method and program
JP3988574B2 (en) Image processing device
EP3048558A1 (en) Object detecting method and object detecting apparatus
JP2008275366A (en) Stereoscopic 3-d measurement system
WO2021193672A1 (en) Three-dimensional model generation method and three-dimensional model generation device
JP4836065B2 (en) Edge tracking method and computer program therefor
JP6409769B2 (en) 3D shape measuring apparatus, 3D shape measuring method, and 3D shape measuring program
JPH0991436A (en) Image processing method and device therefor
JP4337203B2 (en) Distance image generating apparatus, distance image generating method, and program providing medium
JP6659095B2 (en) Image processing apparatus, image processing method, and program
CN108090930A (en) Barrier vision detection system and method based on binocular solid camera
CN116597361A (en) Image recognition tracking method, device and equipment of cleaning machine and readable storage medium
KR20170001448A (en) Apparatus for measuring position of camera using stereo camera and method using the same
JP2017016356A5 (en)
CN106934818B (en) Hand motion tracking method and system