JP5582572B2 - Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus - Google Patents

Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus Download PDF

Info

Publication number
JP5582572B2
JP5582572B2 JP2010250252A JP2010250252A JP5582572B2 JP 5582572 B2 JP5582572 B2 JP 5582572B2 JP 2010250252 A JP2010250252 A JP 2010250252A JP 2010250252 A JP2010250252 A JP 2010250252A JP 5582572 B2 JP5582572 B2 JP 5582572B2
Authority
JP
Japan
Prior art keywords
image
pixel
window
reference image
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2010250252A
Other languages
Japanese (ja)
Other versions
JP2012103815A (en
Inventor
卓郎 西
文明 富田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
National Institute of Advanced Industrial Science and Technology AIST
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Institute of Advanced Industrial Science and Technology AIST filed Critical National Institute of Advanced Industrial Science and Technology AIST
Priority to JP2010250252A priority Critical patent/JP5582572B2/en
Publication of JP2012103815A publication Critical patent/JP2012103815A/en
Application granted granted Critical
Publication of JP5582572B2 publication Critical patent/JP5582572B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

本発明は、画像処理方法、画像処理プログラム、これを記憶したコンピュータ読み取り可能な記憶媒体、及び画像処理装置に関するものである。   The present invention relates to an image processing method, an image processing program, a computer-readable storage medium storing the image processing program, and an image processing apparatus.

FA分野などにおいて、画像認識技術が普及している。この画像認識技術の一つとしてステレオビジョン法がある。ステレオビジョン法は、複数のカメラからによって撮像された視点の異なる画像を利用して3次元情報を復元する技術であり、計測対象物の3次元形状や寸法、位置姿勢を高精度に計測可能という、他の画像認識技術では実現できない機能を有している。このため、ランダムに積載された部品群を対象とするロボットアームピッキングなどに利用されるなど産業界での応用例は幅広く、また、画像情報を異なる視点から取得するだけでよいために特殊なハードウェアを必要とせずに低コストで実現できる技術であることからも、ステレオビジョン法による位置姿勢計測は実用化が強く期待されている技術である。   Image recognition technology is prevalent in the FA field and the like. One of the image recognition techniques is the stereo vision method. The stereo vision method is a technology that restores three-dimensional information using images taken from a plurality of cameras with different viewpoints, and can measure the three-dimensional shape, dimensions, position and orientation of a measurement object with high accuracy. It has functions that cannot be realized by other image recognition technologies. For this reason, it has a wide range of applications in the industry, such as robot arm picking for randomly loaded parts, and special hardware is required because image information only needs to be acquired from different viewpoints. Because it is a technology that can be realized at low cost without the need for wear, the position and orientation measurement by the stereo vision method is a technology that is strongly expected to be put to practical use.

このステレオビジョン法では、三角測量を用いて3次元の位置を計算しているが、この3次元の位置を計算するためには、ある空間点が2つの画像上に投影された点の位置を特定する必要がある。具体的には、一方の画像を基準画像、もう一方の画像を参照画像とし、基準画像中の特定の位置の画素に対して、参照画像中から同じ点を探索する必要がある。この基準画像の特定の位置の画素に対応する参照画像中の対応点を探索するためには、例えば以下の数式1で示される差分絶対値和(SAD:Sum of Absolute Difference)や差分二乗和(SSD:Sum of Squared Difference)を用いて対応点探索処理が実行される。

Figure 0005582572
なお、画像の大きさをM×N、一方の画像の位置(i,j)における画素値をT(i,j)、もう一方の画像の位置(i,j)における画素値をI(i,j)とする。
これらSADやSSDの値が最も小さくなるような2次元位置を、基準画像に対する参照画像の対応点としている。そして、非特許文献1に開示されているように、再帰相関法を用いることによって、その計算量を大幅に低減することができ、ひいては、処理時間を短縮することが可能である。 In this stereo vision method, the three-dimensional position is calculated using triangulation. In order to calculate the three-dimensional position, the position of a point where a certain spatial point is projected on two images is calculated. Need to be identified. Specifically, it is necessary to search for the same point in the reference image for a pixel at a specific position in the standard image, with one image as the standard image and the other image as the reference image. In order to search for a corresponding point in the reference image corresponding to a pixel at a specific position in the reference image, for example, a sum of absolute differences (SAD) or a sum of squared differences (SAD) expressed by the following Equation 1 is used. Corresponding point search processing is executed using SSD (Sum of Squared Difference).
Figure 0005582572
Note that the size of the image is M × N, the pixel value at the position (i, j) of one image is T (i, j), and the pixel value at the position (i, j) of the other image is I (i , J).
The two-dimensional position where the values of these SAD and SSD are the smallest is taken as the corresponding point of the reference image with respect to the standard image. Then, as disclosed in Non-Patent Document 1, by using the recursive correlation method, the amount of calculation can be greatly reduced, and thus the processing time can be shortened.

岡田慧、加賀美聡、稲葉雅幸、井上博允、再帰相関法とマルチメディア命令による高速オプティカルフロー計算法、コンピュータヴィジョンとイメージメディア、115−17、pp.127−132、1999年3月Satoshi Okada, Misaki Kaga, Masayuki Inaba, Hiroki Inoue, Recursive Correlation Method and Fast Optical Flow Calculation Method with Multimedia Instruction, Computer Vision and Image Media, 115-17, pp. 127-132, March 1999

しかしながら、上述した差分絶対値和や差分二乗和を用いた対応点探索処理では、基準画像と参照画像との間における輝度差が大きい場合や、基準画像又は参照画像内におけるコントラストが低い場合には誤対応が多発するために、正常に距離計測が行えなくなるという問題が発生する。このため、基準画像と参照画像との間における輝度差が大きい場合や、基準画像又は参照画像内のコントラストが低い場合には、数式2に示される正規化相互相関(NCC:Normalized Cross-Correlation)を用いて対応点探索処理をする必要があった。

Figure 0005582572
しかし、このNCCを用いた対応点探索処理は、SADなどを用いた対応点探索処理のように再帰相関法を使用することができないため、計算量が多く、処理速度が遅くなるという問題があった。 However, in the corresponding point search process using the above-described difference absolute value sum or difference sum of squares, when the luminance difference between the standard image and the reference image is large, or when the contrast in the standard image or the reference image is low Due to the frequent occurrence of erroneous correspondence, there arises a problem that distance measurement cannot be performed normally. For this reason, when the luminance difference between the standard image and the reference image is large, or when the contrast in the standard image or the reference image is low, the normalized cross-correlation (NCC) shown in Equation 2 is used. It was necessary to perform corresponding point search processing using.
Figure 0005582572
However, the corresponding point search process using NCC cannot use the recursive correlation method like the corresponding point search process using SAD or the like, and thus has a problem that the calculation amount is large and the processing speed is slow. It was.

そこで、本発明は、基準画像と参照画像との間における輝度差が大きい場合や、基準画像や参照画像内のコントラストが低い場合であっても処理速度を落とすことなく適切に対応点探索処理を行うことのできる画像処理方法、画像処理プログラム、これを記憶したコンピュータ読み取り可能な記憶媒体、及び画像処理装置を提供することを課題とする。   Therefore, the present invention appropriately performs the corresponding point search process without reducing the processing speed even when the luminance difference between the standard image and the reference image is large or when the contrast in the standard image or the reference image is low. An object is to provide an image processing method, an image processing program, a computer-readable storage medium storing the image processing program, and an image processing apparatus.

本発明に係る画像処理方法は、異なる視点から撮像された対象物の2枚の画像を基準画像及び参照画像として取得するステップと、前記基準画像及び参照画像における各画素の輝度をそれぞれ正規化処理する正規化処理ステップと、前記正規化処理された基準画像上に設定された基準ウィンドウ内の各画素と、前記正規化処理された参照画像上に設定され前記基準ウィンドウと同一サイズの参照ウィンドウ内の各画素との相関を算出することにより、前記基準画像上の注目点に対応する前記参照画像上の対応点を探索する対応点探索処理ステップと、を含み、前記正規化処理ステップは、前記基準画像及び参照画像上のそれぞれに設定された正規化処理ウィンドウ内の中央に位置する画素の輝度Iを、前記正規化処理ウィンドウ内における各画素の輝度の平均値μで減算したものを、前記正規化処理ウィンドウ内における各画素の輝度の標準偏差σで除算することにより正規化処理し、この正規化処理を前記基準画像及び参照画像の全画素毎に行う。   The image processing method according to the present invention includes a step of acquiring two images of an object captured from different viewpoints as a standard image and a reference image, and a normalization process for the luminance of each pixel in the standard image and the reference image. Normalization processing step, each pixel in the reference window set on the normalized reference image, and a reference window of the same size as the reference window set on the normalized reference image A corresponding point search processing step of searching for a corresponding point on the reference image corresponding to the target point on the base image by calculating a correlation with each pixel of the reference image, and the normalization processing step includes The luminance I of the pixel located at the center in the normalization processing window set on each of the reference image and the reference image is set in each normalization processing window. A value obtained by subtracting the average value μ of the prime luminance is divided by the standard deviation σ of the luminance of each pixel in the normalization processing window, and this normalization processing is performed on the reference image and the reference image. This is done for every pixel.

この画像処理方法は、対応点探査処理ステップの前に、基準画像及び参照画像における各画素の輝度をそれぞれ上述した方法で正規化処理している。このため、基準画像と参照画像との間における輝度差が大きい場合や、基準画像や参照画像内のコントラストが低い場合に、対応点探索処理ステップとしてSADやSSDを利用しても、誤対応が発生せず、適切に距離計測を行うことができる。なお、オクルージョンの問題を軽減するために、上記対象物の画像を3枚以上とすることもできる。また、上記正規化処理の式は、(I−μ)/σとなる。   In this image processing method, the luminance of each pixel in the base image and the reference image is normalized by the above-described method before the corresponding point search processing step. For this reason, when the brightness difference between the standard image and the reference image is large, or when the contrast in the standard image or the reference image is low, even if SAD or SSD is used as the corresponding point search processing step, there is an erroneous response. It does not occur, and distance measurement can be performed appropriately. In order to reduce the problem of occlusion, the number of images of the object can be three or more. The normalization formula is (I−μ) / σ.

なお、上記正規化処理ウィンドウは、基準ウィンドウと同一サイズに設定することが好ましい。   Note that the normalization window is preferably set to the same size as the reference window.

また、上記対応点探索処理ステップは、基準画像上に設定された基準ウィンドウ内の各画素の画素値と、参照画像上に設定された参照ウィンドウ内の各画素の画素値との差分絶対値和(SAD:Sum of Absolute Difference)を再帰相関法を用いて算出することで行うことが、迅速な画像処理を実現する観点から好ましい。その他にも、上記対応点探索処理ステップは、基準ウィンドウ内の各画素の画素値と、参照画像上に設定された参照ウィンドウ内の各画素の画素値との差分二乗和(SSD:Sum of Squared Difference)を再帰相関法を用いて算出することで行うこともできる。   Further, the corresponding point search processing step includes a sum of absolute differences between a pixel value of each pixel in the reference window set on the reference image and a pixel value of each pixel in the reference window set on the reference image. It is preferable to calculate (SAD: Sum of Absolute Difference) by using the recursive correlation method from the viewpoint of realizing rapid image processing. In addition, the corresponding point search processing step includes a sum of squares of differences (SSD: Sum of Squared) between the pixel value of each pixel in the reference window and the pixel value of each pixel in the reference window set on the reference image. Difference) can also be calculated by using a recursive correlation method.

また、上記対応点探索処理ステップは、エピポーラ線上に沿って参照画像内における対応点を探索することにより、探索範囲をエピポーラ線上に絞って探索することができ、対応点探索に要する計算量を少なくすることが可能となる。   In addition, the corresponding point search processing step can search by searching for the corresponding points in the reference image along the epipolar line so that the search range can be narrowed down to the epipolar line, and the amount of calculation required for the corresponding point search is reduced. It becomes possible to do.

また、本発明に係る画像処理プログラムは、上記いずれかに記載のステップをコンピュータに実行させるものである。   An image processing program according to the present invention causes a computer to execute any of the steps described above.

また、本発明に係るコンピュータ読み取り可能な記憶媒体は、上記画像処理プログラムを記憶したものである。   A computer-readable storage medium according to the present invention stores the image processing program.

また、本発明に係る画像処理装置は、撮影対象物を異なる視点から2枚の画像を基準画像及び参照画像として撮像する撮像部と、前記撮像部によって撮像された前記基準画像及び前記参照画像を画像処理する演算処理部と、を備え、前記演算処理部は、前記基準画像及び参照画像上のそれぞれに設定された正規化処理ウィンドウ内の中央に位置する画素の輝度Iを、前記正規化処理ウィンドウ内における各画素の輝度の平均値μで減算したものを、前記正規化処理ウィンドウ内における各画素の輝度の標準偏差σで除算することにより正規化処理し、この正規化処理を前記基準画像及び参照画像の全画素毎に行い、前記正規化処理された基準画像上に設定された基準ウィンドウ内の各画素と、前記正規化処理された参照画像上に設定され前記基準ウィンドウと同一サイズの参照ウィンドウ内の各画素との相関を算出することにより、前記基準画像上の注目点に対応する前記参照画像上の対応点を探索するように構成されている。   The image processing apparatus according to the present invention also includes an imaging unit that captures two images from different viewpoints as a standard image and a reference image, and the standard image and the reference image captured by the imaging unit. An arithmetic processing unit that performs image processing, and the arithmetic processing unit calculates a luminance I of a pixel located at a center in a normalization processing window set on each of the standard image and the reference image, and performs the normalization processing A value obtained by subtracting the average value μ of the luminance of each pixel in the window is divided by a standard deviation σ of the luminance of each pixel in the normalization processing window, and this normalization processing is performed on the reference image. And each pixel in the reference window set on the normalized reference image, and the reference image set on the normalized reference image. By calculating the correlation with each pixel in the reference window having the same size as the quasi-window, the corresponding point on the reference image corresponding to the attention point on the reference image is searched.

この画像処理装置によれば、演算処理部が、まず、上述したように基準画像及び参照画像における各画素の輝度をそれぞれ正規化処理し、その後、対応点探索処理を行うため、基準画像と参照画像との間における輝度差が大きい場合や、基準画像や参照画像内のコントラストが低い場合に、対応点探索処理ステップとしてSADやSSDを利用しても、誤対応が発生せず、適切に距離計測を行うことができる。なお、上記正規化処理ウィンドウは、基準ウィンドウと同一サイズであることが好ましい。   According to this image processing apparatus, the arithmetic processing unit first normalizes the luminance of each pixel in the standard image and the reference image as described above, and then performs the corresponding point search process. When there is a large luminance difference from the image or when the contrast in the base image or the reference image is low, even if SAD or SSD is used as the corresponding point search processing step, no miscorrespondence occurs, and an appropriate distance is obtained. Measurement can be performed. The normalization processing window is preferably the same size as the reference window.

本発明によれば、基準画像と参照画像との間における輝度差が大きい場合や、基準画像や参照画像内のコントラストが低い場合であっても処理速度を落とすことなく適切に対応点探索処理を行うことができる。   According to the present invention, even when the luminance difference between the standard image and the reference image is large or when the contrast in the standard image or the reference image is low, the corresponding point search process is appropriately performed without reducing the processing speed. It can be carried out.

図1は本実施形態に係る画像処理装置の概略構成を示すブロック図である。FIG. 1 is a block diagram showing a schematic configuration of an image processing apparatus according to the present embodiment. 図2は本実施形態に係る画像処理方法を示すフローチャートである。FIG. 2 is a flowchart showing an image processing method according to this embodiment. 図3は本実施形態に係る正規化処理ステップの概略を示す説明図であるFIG. 3 is an explanatory diagram showing an outline of normalization processing steps according to the present embodiment. 図4は本実施形態に係る対応点探索処理ステップを示す説明図である。FIG. 4 is an explanatory diagram showing corresponding point search processing steps according to the present embodiment. 図5は本実施形態に係る対応点探索処理ステップにおける再帰相関法の概略を示す説明図である。FIG. 5 is an explanatory diagram showing an outline of the recursive correlation method in the corresponding point search processing step according to the present embodiment. 図6は実施例における基準画像(a)と参照画像(b)を示す画像である。FIG. 6 is an image showing a standard image (a) and a reference image (b) in the embodiment. 図7は実施例1における3次元復元を行った結果を示すグラフである。FIG. 7 is a graph showing the result of three-dimensional restoration in Example 1. 図8は比較例1における3次元復元を行った結果を示すグラフである。FIG. 8 is a graph showing the result of three-dimensional restoration in Comparative Example 1.

以下、本発明に係る実施形態について図面を参照しつつ説明する。   Hereinafter, embodiments according to the present invention will be described with reference to the drawings.

図1は、本発明の一実施形態によるステレオビジョン画像処理装置1の基本構成を示している。本装置1は、演算処理部(以下、CPUと記す)2、データを記録する記録部3、記憶部(以下、メモリと記す)4、インターフェース部5、及びこれら各部の間でデータ(制御信号を含む)を交換するための内部バス6から構成された本体部10を備えている。また、この本体部10に、インターフェース部5を介して、操作部7、表示部8、第1及び第2撮像部C1、C2が接続されている。   FIG. 1 shows a basic configuration of a stereo vision image processing apparatus 1 according to an embodiment of the present invention. The apparatus 1 includes an arithmetic processing unit (hereinafter referred to as CPU) 2, a recording unit 3 for recording data, a storage unit (hereinafter referred to as memory) 4, an interface unit 5, and data (control signal) between these units. The main body 10 is composed of an internal bus 6 for exchanging. The operation unit 7, the display unit 8, and the first and second imaging units C <b> 1 and C <b> 2 are connected to the main body unit 10 through the interface unit 5.

CPU2は、記録部3から所定のプログラムをメモリ4に読み出し、メモリ4の一部をワークエリアとして使用して、所定のデータ処理を実行するものであり、例えば、インターフェース部5を介して操作部7からの指示やデータの入力を受け、入力されたデータを記録部3に記録しつつ指示された処理を実行するなど、それらに応じた処理を実行する。また、CPU2は、実行途中の演算結果や、処理完了後の最終結果を適宜、記録部3に記録したり、インターフェース部5を介して所定の情報を表示部8に表示したりする。例えば、操作部7からの入力を受け付けるためのグラフィカルなユーザーインターフェース画像を表示部8に表示する。本装置は、コンピュータで実現することができ、その場合は、例えば、操作部7としてコンピュータ用のキーボードやマウスを使用し、表示部8としてCRTディスプレイや液晶ディスプレイ等を使用することができる。   The CPU 2 reads a predetermined program from the recording unit 3 into the memory 4 and executes predetermined data processing using a part of the memory 4 as a work area. For example, the operation unit via the interface unit 5 In response to an instruction or data input from 7, the instructed process is executed while the input data is recorded in the recording unit 3, and the corresponding process is executed. In addition, the CPU 2 appropriately records a calculation result during execution and a final result after completion of processing in the recording unit 3 or displays predetermined information on the display unit 8 via the interface unit 5. For example, a graphical user interface image for accepting input from the operation unit 7 is displayed on the display unit 8. This apparatus can be realized by a computer. In this case, for example, a computer keyboard or mouse can be used as the operation unit 7, and a CRT display, a liquid crystal display, or the like can be used as the display unit 8.

第1及び第2撮像部C1、C2は、所定の間隔で所定の位置に配置され、撮像の対象物Tを撮像し、撮像された画像データを本体部10に伝送する。本体部10では、インターフェース部5を介して取得した各撮像部C1,C2からの画像データを、区別可能に、例えば、各撮像部C1、C2に対応する異なるファイル名を付けて、第1撮像部C1によって撮像された画像を基準画像、第2撮像部C2によって撮像された画像を参照画像として記録部3に記録する。なお、第1撮像部C1によって撮像された画像を参照画像、第2撮像部C2によって撮像された画像を基準画像としてもよい。   The first and second imaging units C <b> 1 and C <b> 2 are arranged at predetermined positions at predetermined intervals, capture the imaging target T, and transmit the captured image data to the main body unit 10. In the main body unit 10, the image data from the imaging units C <b> 1 and C <b> 2 acquired via the interface unit 5 can be distinguished from each other, for example, with different file names corresponding to the imaging units C <b> 1 and C <b> 2. The image captured by the unit C1 is recorded in the recording unit 3 as a standard image, and the image captured by the second imaging unit C2 is recorded as a reference image. Note that an image captured by the first imaging unit C1 may be a reference image, and an image captured by the second imaging unit C2 may be a reference image.

第1及び第2撮像部C1、C2からの出力信号がアナログ信号の場合、本体部10はAD(アナログデジタル)変換部(図示省略)を設け、所定の時間間隔で入力されるアナログ信号をサンプリングしてデジタルデータに変換する。なお、第1及び第2撮像部C1、C2からの出力信号がデジタルデータであればAD変換部は不要である。また、第1及び第2撮像部C1、C2は、少なくとも静止画像を撮像できる装置であればよく、例えば、デジタルカメラや、デジタル又はアナログのビデオカメラなどを使用することができる。   When the output signals from the first and second imaging units C1 and C2 are analog signals, the main body unit 10 is provided with an AD (analog-digital) conversion unit (not shown), and samples the analog signals input at predetermined time intervals. To convert it into digital data. If the output signals from the first and second imaging units C1 and C2 are digital data, the AD conversion unit is unnecessary. The first and second imaging units C1 and C2 may be any device that can capture at least a still image. For example, a digital camera or a digital or analog video camera can be used.

以下、本装置1が行う処理について、図2のフローチャートに基づいて説明する。なお、以下においては、特に断らない限り、CPU2が行う処理、すなわちCPU2が各部を制御して行う処理として記載する。また、第1及び第2撮像部C1、C2は、測定対象物Tを撮像可能なように、所定位置に所定方向を向けて配置されており、その位置及び撮像方向の情報は記録部3に記録されている。また、第1及び第2撮像部C1、C2の内部及び外部パラメータは、予め校正実験によって求められ、記録部3に記録されている。   Hereinafter, processing performed by the apparatus 1 will be described based on the flowchart of FIG. In the following description, unless otherwise specified, the processing performed by the CPU 2, that is, the processing performed by the CPU 2 by controlling each unit is described. In addition, the first and second imaging units C1 and C2 are arranged with a predetermined direction facing a predetermined position so that the measurement object T can be imaged. Information on the position and the imaging direction is stored in the recording unit 3. It is recorded. Further, the internal and external parameters of the first and second imaging units C1 and C2 are obtained in advance by a calibration experiment and recorded in the recording unit 3.

まず、ステップS1において、初期設定を行う。この初期設定は、ステップS2以降の処理を行うために必要な処理であり、例えば、第1及び第2撮像部C1、C2とのデータ伝送経路や制御プロトコルを確立し、第1及び第2撮像部C1、C2を制御可能とする。   First, in step S1, initial setting is performed. This initial setting is a process necessary for performing the processes after step S2. For example, a data transmission path and a control protocol with the first and second imaging units C1 and C2 are established, and the first and second imaging are performed. The parts C1 and C2 can be controlled.

次に、ステップS2において、第1及び第2撮像部C1、C2で対象物Tを撮像し、基準画像及び参照画像を取得する。なお、第1及び第2撮像部C1,C2によって撮像された画像は、本体部10に伝送されて、所定のファイル名で記録部3に記録される。これによって、記録部3には、それぞれ異なる位置、異なる方向から撮像された2枚の2次元画像データが基準画像、参照画像として記録される。なお、2枚の2次元画像データのうち、どちらを基準画像にしてもよい。   Next, in step S2, the target T is imaged by the first and second imaging units C1 and C2, and a standard image and a reference image are acquired. The images captured by the first and second imaging units C1 and C2 are transmitted to the main body unit 10 and recorded in the recording unit 3 with a predetermined file name. As a result, two two-dimensional image data captured from different positions and different directions are recorded in the recording unit 3 as the standard image and the reference image. Either of the two pieces of two-dimensional image data may be used as the reference image.

続いて、ステップS3として、この基準画像及び参照画像に対して正規化処理をする。基準画像を正規化処理する方法について詳細に説明すると、図3(a)に示すように、基準画像A上のある特定の位置に、後述する基準ウィンドウW1と同一サイズの正規化処理ウィンドウW3を設定する。そして、この位置における正規化処理ウィンドウW3内の各画素の輝度の平均値μ及び標準偏差σを算出する。そして、この位置における正規化処理ウィンドウW3内の画素の輝度の平均値μ及び標準偏差σを用いて、正規化処理ウィンドウW3の中央に位置する画素Cの輝度Iを以下の式に基づき正規化する。なお、図3中において、正規化処理された画素を斜線で示す。
(I−μ)/σ
次に、図3(b)に示すように、正規化処理ウィンドウW3を右に一画素分だけずらし、この位置での正規化処理ウィンドウW3内における各画素の輝度の平均値μ及び標準偏差σを算出し、上記同様に、この位置での正規化処理ウィンドウW3の中央に位置する画素Cの輝度Iを以下の式に基づき正規化する。
(I−μ)/σ
以上の作業を繰り返すよう、正規化処理ウィンドウW3を基準画像A上において走査させることで、基準画像Aを構成する全画素に対して正規化処理を実行する。なお、参照画像Bについても同様の方法で全画素に対して正規化処理を行う。
Subsequently, in step S3, normalization processing is performed on the standard image and the reference image. The method for normalizing the reference image will be described in detail. As shown in FIG. 3A, a normalization processing window W3 having the same size as the reference window W1 described later is provided at a specific position on the reference image A. Set. Then, the average value μ 1 and the standard deviation σ 1 of the luminance of each pixel in the normalization processing window W3 at this position are calculated. Then, using the average luminance value μ 1 and standard deviation σ 1 of the pixels in the normalization processing window W3 at this position, the luminance I 1 of the pixel C 1 located in the center of the normalization processing window W3 is expressed by the following equation: Normalize based on. In FIG. 3, the normalized pixels are indicated by diagonal lines.
(I 11 ) / σ 1
Next, as shown in FIG. 3B, the normalization processing window W3 is shifted to the right by one pixel, and the average value μ 2 and standard deviation of the luminance of each pixel in the normalization processing window W3 at this position. σ 2 is calculated, and similarly to the above, the luminance I 2 of the pixel C 2 located at the center of the normalization processing window W 3 at this position is normalized based on the following expression.
(I 2 −μ 2 ) / σ 2
By scanning the normalization processing window W3 on the reference image A so as to repeat the above operation, the normalization processing is executed for all the pixels constituting the reference image A. For the reference image B, the normalization process is performed on all pixels in the same manner.

以上のように正規化処理された基準画像Aと参照画像Bとの間で、対応点探索処理を行う(ステップS4)。図4を参照しつつ詳細に説明すると、まず、基準画像Aのある画素を注目点Pとして設定し、この注目点Pを中心として基準画像A上に基準ウィンドウW1を設定する。なお、基準ウィンドウW1がラスタ走査されることによって、基準画像A上の全画素、若しくは、一定の間隔をあけて複数の画素が、注目点Pとして順次設定される。また、参照画像B上にも同様に、ある画素を中心とした参照ウィンドウW2を設定する。この参照ウィンドウW2は、基準ウィンドウW1と同一サイズであり、参照画像B上を走査しながら基準画像Aに設定した基準ウィンドウW1との類似度が最も高い領域を探索する。ここで、マッチングの際の誤りや計算量を軽減する観点から、参照ウィンドウW2を参照画像B上の対応するエピポーラ線上に設定し、参照ウィンドウW2をエピポーラ線上で走査しながら、基準画像Aに設定した基準ウィンドウW1との類似度が最も高い領域を探索することが好ましい。この探索の結果、参照画像B内において類似度が最も高い位置を、基準画像Aの注目点Pの対応点として特定する。なお、この基準ウィンドウW1や参照ウィンドウW2の大きさは特に限定されるものではなく,対象物の大きさや濃度変化および画像密度により決定される。   Corresponding point search processing is performed between the standard image A and the reference image B that have been normalized as described above (step S4). Referring to FIG. 4 in detail, first, a certain pixel of the reference image A is set as the attention point P, and a reference window W1 is set on the reference image A around the attention point P. Note that, by raster scanning the reference window W1, all the pixels on the reference image A or a plurality of pixels with a certain interval are sequentially set as the attention point P. Similarly, a reference window W2 centered on a certain pixel is set on the reference image B. The reference window W2 has the same size as the standard window W1, and searches for a region having the highest similarity with the standard window W1 set for the standard image A while scanning the reference image B. Here, from the viewpoint of reducing errors in matching and the amount of calculation, the reference window W2 is set on the corresponding epipolar line on the reference image B, and the reference window W2 is set on the reference image A while scanning on the epipolar line. It is preferable to search for a region having the highest degree of similarity with the reference window W1. As a result of this search, the position having the highest similarity in the reference image B is specified as the corresponding point of the attention point P of the standard image A. Note that the sizes of the standard window W1 and the reference window W2 are not particularly limited, and are determined by the size, density change, and image density of the object.

上述した対応点探索の際には、基準画像A上に設定された基準ウィンドウW1内における各画素値と、参照画像B上に設定された参照ウィンドウW2内における各画素値との差分絶対値和(SAD: Sum of Absolute Difference)や、基準画像A上に設定された基準ウィンドウW1内における各画素値と、参照画像B上に設定された参照ウィンドウW2内における各画素値との差分二乗和(SSD:Sum of Squared Difference)を用いて、類似度を評価することができる。また、これら差分絶対値和や、差分二乗和の計算量を低減させるために、再帰相関法を用いることが好ましい。そして、上記差分絶対値和や差分二乗和が最も小さくなる点を最も類似度が高い点として対応点を特定する。   In the above-described corresponding point search, the sum of absolute differences between each pixel value in the standard window W1 set on the standard image A and each pixel value in the reference window W2 set on the reference image B (SAD: Sum of Absolute Difference) or the sum of squared differences between each pixel value in the standard window W1 set on the standard image A and each pixel value in the reference window W2 set on the reference image B ( The degree of similarity can be evaluated using SSD (Sum of Squared Difference). In order to reduce the amount of calculation of the sum of absolute differences and the sum of squared differences, it is preferable to use a recursive correlation method. And a corresponding point is specified by making the point with the smallest difference absolute value sum or the sum of squared differences the point with the highest similarity.

なお、再帰相関法について図5を参照しつつ説明する。

Figure 0005582572
とすると、
以下のSADの式
Figure 0005582572
(ただし、画素(x、y)での輝度値をI1(x、y)、I2(x、y)とし、x、yの領域を0≦x、y<Nとする。また、相関演算のウィンドウサイズをW×Wとし、その値域を0≦i,j<Wとする。さらに、探索範囲k、lの値域を0≦k、l<Dとする。)
の相関演算は、
Figure 0005582572
と書ける。ここで、
Figure 0005582572
とすると、
Figure 0005582572
と再帰的に計算することができる。さらにQ1(x、y、k、l)やQ2(x、y、k、l)も再帰的に計算することができる。 The recursive correlation method will be described with reference to FIG.
Figure 0005582572
Then,
The following SAD equation
Figure 0005582572
(However, the luminance values at the pixel (x, y) are I 1 (x, y) and I 2 (x, y), and the x and y regions are 0 ≦ x and y <N. (The window size of the operation is W × W, and the range is 0 ≦ i, j <W. Further, the range of the search ranges k and l is 0 ≦ k and l <D.)
The correlation operation of
Figure 0005582572
Can be written. here,
Figure 0005582572
Then,
Figure 0005582572
And can be calculated recursively. Furthermore, Q1 (x, y, k, l) and Q2 (x, y, k, l) can also be calculated recursively.

以上のようにして、対応点が特定されると、三角測量の原理により距離画像が生成される。上述したように探索した対応点に基づいて距離画像を生成する(ステップS5)。   When the corresponding points are specified as described above, a distance image is generated based on the principle of triangulation. A distance image is generated based on the corresponding points searched as described above (step S5).

そして、上記ステップS5で生成した距離画像を記録部3に記録し(ステップS6)、画像処理を終了する。   Then, the distance image generated in step S5 is recorded in the recording unit 3 (step S6), and the image processing ends.

図2に示したブロック図中の各ステップは、所定のプログラムをコンピュータに実行させることにより実現することができる。このプログラムは、CD−ROM等のコンピュータ読み取り可能な記録媒体に記録して配布することも可能であるが、インターネット等を通じて配信することも可能である。   Each step in the block diagram shown in FIG. 2 can be realized by causing a computer to execute a predetermined program. This program can be recorded and distributed on a computer-readable recording medium such as a CD-ROM, but can also be distributed via the Internet or the like.

以上、本発明の実施形態について説明したが、本発明はこれらに限定されるものではなく、本発明の趣旨を逸脱しない限りにおいて種々の変更が可能である。例えば、上記実施形態では、2枚の画像で距離画像を生成しているが、これを3枚以上の画像から距離画像を生成することができる。この場合は、撮像部をその分増やして、基準画像Aを一枚、参照画像Bを複数枚とし、基準画像Aの注目点Pに対応する対応点を各参照画像Bから上記実施形態と同様の方法で探索する。   As mentioned above, although embodiment of this invention was described, this invention is not limited to these, A various change is possible unless it deviates from the meaning of this invention. For example, in the above embodiment, the distance image is generated from two images, but a distance image can be generated from three or more images. In this case, the number of imaging units is increased by that amount, one base image A and a plurality of reference images B, and corresponding points corresponding to the attention point P of the base image A are determined from each reference image B as in the above embodiment. Search by the method.

以下に実施例及び比較例を示して、本発明をさらに具体的に説明する。なお、本発明は、下記実施例に限定されるものではない。   The present invention will be described more specifically with reference to the following examples and comparative examples. In addition, this invention is not limited to the following Example.

2台のデジタルカメラを用いて、対象物Tである半解凍状態のタラの半身を異なる視点から撮像し、基準画像(図6(a))と参照画像(図6(b))を取得した。条件としては、基準カメラが対象物Tの設置面より610mm上方に設置されており、参照カメラが基準カメラから150mm右に離れた位置に設置されている。また、画像サイズは640×480pixelであり、画像取り込みレートは15fps、照明は4本の20W直流蛍光灯である。なお、基準カメラとは基準画像を撮像するカメラであり、参照カメラとは参照画像を撮像するカメラである。   Using two digital cameras, the half body of the half-decompressed cod that is the object T was imaged from different viewpoints, and a reference image (FIG. 6A) and a reference image (FIG. 6B) were acquired. . As a condition, the standard camera is installed 610 mm above the installation surface of the object T, and the reference camera is installed at a position 150 mm to the right of the standard camera. The image size is 640 × 480 pixels, the image capture rate is 15 fps, and the illumination is four 20 W DC fluorescent lamps. The standard camera is a camera that captures a standard image, and the reference camera is a camera that captures a reference image.

以上の2つの画像に対して、15×15pixelの正規化処理ウィンドウW3で上述したように各画素の輝度を正規化処理し、その後、15×15pixelの基準ウィンドウW1及び参照ウィンドウW2で再帰相関法を用いたSADを利用して対応点探索処理を行い、3次元復元した結果が図7に示したグラフである(実施例1)。また、正規化処理を行わずに、単に基準画像と参照画像とを再帰相関法を用いたSADを利用して対応点探索処理を行い、3次元復元した結果が図8のグラフである(比較例1)。なお、各グラフのX、Y軸の値は、基準画像の画素座標(ピクセル)を示し、Z軸の値は視差を示している。   With respect to the above two images, the luminance of each pixel is normalized as described above in the normalization window W3 of 15 × 15 pixels, and then the recursive correlation method is performed in the reference window W1 and the reference window W2 of 15 × 15 pixels. FIG. 7 is a graph showing the result of performing the corresponding point search process using the SAD using the three-dimensional reconstruction (Example 1). Further, the result of three-dimensional restoration by performing the corresponding point search process using the SAD using the recursive correlation method for the standard image and the reference image without performing the normalization process is the graph of FIG. Example 1). The X and Y axis values of each graph indicate pixel coordinates (pixels) of the reference image, and the Z axis value indicates parallax.

図7及び図8のグラフから分かるように、比較例1では、誤対応によって、実際には存在しない線状のノイズや、距離測定が不能となった穴が多発しているが(図8参照)、実施例1では、そのような誤対応がほとんど発生していないことが分かる(図7参照)。   As can be seen from the graphs of FIGS. 7 and 8, in Comparative Example 1, there are many linear noises that do not actually exist and holes in which distance measurement is impossible due to mishandling (see FIG. 8). In Example 1, it can be seen that such erroneous correspondence hardly occurs (see FIG. 7).

1 画像処理装置
2 CPU(演算処理部)
A 基準画像
B 参照画像
P 注目点
T 対象物
W1 正規化処理ウィンドウ
W2 基準ウィンドウ
W3 参照ウィンドウ
1 Image processing device 2 CPU (arithmetic processing unit)
A reference image B reference image P attention point T object W1 normalization processing window W2 reference window W3 reference window

Claims (8)

異なる視点から撮像された対象物の2枚の画像を基準画像及び参照画像として取得するステップと、
前記基準画像及び参照画像における各画素の輝度をそれぞれ正規化処理する正規化処理ステップと、
前記正規化処理された基準画像上に設定された基準ウィンドウ内の各画素と、前記正規化処理された参照画像上に設定され前記基準ウィンドウと同一サイズの参照ウィンドウ内の各画素との相関を算出することにより、前記基準画像上の注目点に対応する前記参照画像上の対応点を探索する対応点探索処理ステップと、
を含み、
前記正規化処理ステップは、前記基準画像及び参照画像上のそれぞれに設定された正規化処理ウィンドウ内の中央に位置する画素の輝度Iを、前記正規化処理ウィンドウ内における各画素の輝度の平均値μで減算したものを、前記正規化処理ウィンドウ内における各画素の輝度の標準偏差σで除算することにより正規化処理し、この正規化処理を前記基準画像及び参照画像の全画素毎に行う、画像処理方法。
Obtaining two images of the object imaged from different viewpoints as a standard image and a reference image;
Normalization processing steps for normalizing the luminance of each pixel in the standard image and the reference image;
Correlation between each pixel in the reference window set on the normalized reference image and each pixel in the reference window having the same size as the reference window set on the normalized reference image A corresponding point search processing step of searching for a corresponding point on the reference image corresponding to the target point on the base image by calculating;
Including
In the normalization processing step, the luminance I of the pixel located at the center in the normalization processing window set on each of the standard image and the reference image is calculated as an average value of the luminance of each pixel in the normalization processing window. What is subtracted by μ is normalized by dividing by the standard deviation σ of the luminance of each pixel in the normalization processing window, and this normalization processing is performed for every pixel of the reference image and the reference image. Image processing method.
前記正規化処理ウィンドウは、前記基準ウィンドウと同一サイズに設定されている、請求項1に記載の画像処理方法。   The image processing method according to claim 1, wherein the normalization processing window is set to have the same size as the reference window. 前記対応点探索処理ステップは、前記基準画像上に設定された基準ウィンドウ内の各画素の画素値と、前記参照画像上に設定された参照ウィンドウ内の各画素の画素値との差分絶対値和(SAD:Sum of Absolute Difference)を再帰相関法を用いて算出することで行う、請求項1又は2に記載の画像処理方法。   The corresponding point search processing step includes a difference absolute value sum between a pixel value of each pixel in the reference window set on the reference image and a pixel value of each pixel in the reference window set on the reference image The image processing method of Claim 1 or 2 performed by calculating (SAD: Sum of Absolute Difference) using a recursive correlation method. 前記対応点探索処理ステップは、エピポーラ線上に沿って前記参照画像内における対応点を探索する、請求項1〜3のいずれかに記載の画像処理方法。   The image processing method according to claim 1, wherein the corresponding point search processing step searches for a corresponding point in the reference image along an epipolar line. 請求項1〜4のいずれかに記載の画像処理方法をコンピュータに実行させるための画像処理プログラム。 An image processing program for causing a computer to execute the image processing method according to claim 1. 請求項5に記載の画像処理プログラムを記憶したコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the image processing program according to claim 5. 撮影対象物を異なる視点から2枚の画像を基準画像及び参照画像として撮像する撮像部と、
前記撮像部によって撮像された前記基準画像及び前記参照画像を画像処理する演算処理部と、を備え、
前記演算処理部は、
前記基準画像及び参照画像上のそれぞれに設定された正規化処理ウィンドウ内の中央に位置する画素の輝度Iを、前記正規化処理ウィンドウ内における各画素の輝度の平均値μで減算したものを、前記正規化処理ウィンドウ内における各画素の輝度の標準偏差σで除算することにより正規化処理し、この正規化処理を前記基準画像及び参照画像の全画素毎に行い、
前記正規化処理された基準画像上に設定された基準ウィンドウ内の各画素と、前記正規化処理された参照画像上に設定され前記基準ウィンドウと同一サイズの参照ウィンドウ内の各画素との相関を算出することにより、前記基準画像上の注目点に対応する前記参照画像上の対応点を探索する、画像処理装置。
An imaging unit that captures two images from different viewpoints as a base image and a reference image;
An arithmetic processing unit that performs image processing on the reference image and the reference image captured by the imaging unit,
The arithmetic processing unit includes:
What is obtained by subtracting the luminance I of the pixel located in the center of the normalization processing window set on each of the standard image and the reference image by the average value μ of the luminance of each pixel in the normalization processing window, Normalization processing is performed by dividing by the standard deviation σ of luminance of each pixel in the normalization processing window, and this normalization processing is performed for every pixel of the standard image and the reference image,
Correlation between each pixel in the reference window set on the normalized reference image and each pixel in the reference window having the same size as the reference window set on the normalized reference image An image processing apparatus that searches for a corresponding point on the reference image corresponding to a point of interest on the base image by calculating.
前記正規化処理ウィンドウは、前記基準ウィンドウと同一サイズに設定されている、請求項7に記載の画像処理装置。   The image processing apparatus according to claim 7, wherein the normalization processing window is set to have the same size as the reference window.
JP2010250252A 2010-11-08 2010-11-08 Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus Active JP5582572B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010250252A JP5582572B2 (en) 2010-11-08 2010-11-08 Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010250252A JP5582572B2 (en) 2010-11-08 2010-11-08 Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus

Publications (2)

Publication Number Publication Date
JP2012103815A JP2012103815A (en) 2012-05-31
JP5582572B2 true JP5582572B2 (en) 2014-09-03

Family

ID=46394159

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010250252A Active JP5582572B2 (en) 2010-11-08 2010-11-08 Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus

Country Status (1)

Country Link
JP (1) JP5582572B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11740709B2 (en) * 2021-06-10 2023-08-29 Pixart Imaging Inc. Image quality improving method, optical navigation device control method, and optical navigation device using the methods

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2929106B2 (en) * 1989-07-24 1999-08-03 株式会社トプコン Stereo matching method and apparatus
JP2958462B1 (en) * 1998-10-01 1999-10-06 工業技術院長 Method and apparatus for correcting luminance of stereo image
JP4749879B2 (en) * 2005-03-31 2011-08-17 富士フイルム株式会社 Face discrimination method, apparatus, and program
JP4795737B2 (en) * 2005-07-12 2011-10-19 富士フイルム株式会社 Face detection method, apparatus, and program
JP4840822B2 (en) * 2007-08-29 2011-12-21 独立行政法人産業技術総合研究所 Image processing method, apparatus and program
JP4946896B2 (en) * 2008-01-31 2012-06-06 コニカミノルタホールディングス株式会社 Distance measuring device and distance measuring method
JP5311016B2 (en) * 2008-12-10 2013-10-09 コニカミノルタ株式会社 Stereo camera unit and stereo matching method

Also Published As

Publication number Publication date
JP2012103815A (en) 2012-05-31

Similar Documents

Publication Publication Date Title
US7733404B2 (en) Fast imaging system calibration
US10027947B2 (en) Image processing apparatus and image processing method
JP2005072888A (en) Image projection method and image projection device
US20060215881A1 (en) Distance measurement apparatus, electronic device, distance measurement method, distance measurement control program and computer-readable recording medium
WO2010101227A1 (en) Device for creating information for positional estimation of matter, method for creating information for positional estimation of matter, and program
JP6403115B2 (en) 3D information restoration device, 3D information restoration system, and 3D information restoration method
JP6502511B2 (en) Calculation device, control method of calculation device, and calculation program
JP4941565B2 (en) Corresponding point search apparatus and corresponding point searching method
JP2004235934A (en) Calibration processor, calibration processing method, and computer program
TWI528783B (en) Methods and systems for generating depth images and related computer products
JP6694234B2 (en) Distance measuring device
JP2018087732A (en) Wire rope measurement device and method
JP2008090583A (en) Information processing system, program, and information processing method
JP2016217944A (en) Measurement device and measurement method
TWI571099B (en) Device and method for depth estimation
JP6494402B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP2020134242A (en) Measuring method, measuring device and program
JP5582572B2 (en) Image processing method, image processing program, computer-readable storage medium storing the same, and image processing apparatus
JP6852406B2 (en) Distance measuring device, distance measuring method and distance measuring program
JP6625654B2 (en) Projection device, projection method, and program
WO2019058487A1 (en) Three-dimensional reconstructed image processing device, three-dimensional reconstructed image processing method, and computer-readable storage medium having three-dimensional reconstructed image processing program stored thereon
JP2018032144A (en) Image processor, image processing method and program
JP2012173858A (en) Omnidirectional image generation method, image generation device and program
JPH10289315A (en) Parallax calculation device and method, and distance calculation device and method
EP2953096B1 (en) Information processing device, information processing method, system and carrier means

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130628

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140218

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140411

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140710

R150 Certificate of patent or registration of utility model

Ref document number: 5582572

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250