JP2008298589A - Device and method for detecting positions - Google Patents
Device and method for detecting positions Download PDFInfo
- Publication number
- JP2008298589A JP2008298589A JP2007145122A JP2007145122A JP2008298589A JP 2008298589 A JP2008298589 A JP 2008298589A JP 2007145122 A JP2007145122 A JP 2007145122A JP 2007145122 A JP2007145122 A JP 2007145122A JP 2008298589 A JP2008298589 A JP 2008298589A
- Authority
- JP
- Japan
- Prior art keywords
- optical system
- imaging
- intersection
- image
- position detection
- 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
Links
Images
Abstract
Description
本発明は、位置検出装置及び位置検出方法に関する。 The present invention relates to a position detection device and a position detection method.
従来、複数の撮像装置を用いて対象物の撮像を行い、対象物の3次元座標(位置)を得る位置検出装置、位置検出方法が知られている。 2. Description of the Related Art Conventionally, a position detection device and a position detection method are known in which an object is imaged using a plurality of imaging devices to obtain a three-dimensional coordinate (position) of the object.
しかし、レンズにより構成される光学系を用いた撮像装置で対象物を撮像した画像には色収差、歪曲収差等、様々な種類の収差が含まれている。このうち、特に撮像装置を用いて対象物の位置を検出する場合のように、撮像装置を計測用途に使用する場合等において最も問題となるのは、歪曲収差(distortion)であり、歪曲収差を含んだままでは対象物の位置を正確に検出することはできない。 However, various types of aberrations such as chromatic aberration and distortion are included in an image obtained by imaging an object with an imaging apparatus using an optical system including lenses. Among these, distortion is the most serious problem when the imaging device is used for measurement, such as when detecting the position of an object using an imaging device. If it is included, the position of the object cannot be detected accurately.
従来、この歪曲収差を補正するための手法としては、歪曲収差を関数として表し、入力した画像に対して関数式に基づいて補正をかける手法が知られており、補正の精度を向上させるためには、この関数の近似精度を向上させることが必要である。 Conventionally, as a technique for correcting this distortion, a technique is known in which distortion is expressed as a function, and an input image is corrected based on a functional expression, in order to improve correction accuracy. It is necessary to improve the approximation accuracy of this function.
この点、例えば、関数の精度が目標性能に達するまで多項式の項を増加させる手法を採用するものが提案されている(例えば、特許文献1参照)。また、特殊な関数を利用することにより関数による近似を最適化し補正の精度を向上させる手法も提案されている(例えば、特許文献2参照)。 In this regard, for example, a method is proposed that employs a method of increasing the polynomial term until the accuracy of the function reaches the target performance (see, for example, Patent Document 1). In addition, a method for optimizing approximation by a function by using a special function and improving the accuracy of correction has been proposed (see, for example, Patent Document 2).
しかし、歪曲収差は、対象物から結像面までの距離に応じて変化することが知られている。このため、ある距離では高精度の補正ができたとしても、対象物から結像面までの距離が変わることによって補正の精度が落ちる場合がある。
そこで、これに対応するため、対象物から結像面までの距離に応じて歪曲収差の補正曲線を複数作成し、得られた歪曲収差の補正曲線に基づいて計測値を補正する手法も提案されている(例えば、特許文献3参照)。
However, it is known that the distortion aberration changes according to the distance from the object to the imaging plane. For this reason, even if high-accuracy correction can be performed at a certain distance, the correction accuracy may decrease due to a change in the distance from the object to the imaging plane.
In order to cope with this, a method has been proposed in which a plurality of distortion correction curves are created according to the distance from the object to the imaging plane, and the measurement values are corrected based on the obtained distortion aberration correction curves. (For example, refer to Patent Document 3).
このように、従来は、歪曲収差を補正する手法として、撮像画像に生じる歪曲収差を精度よく明らかにする技術と、対象物の距離に応じて歪曲収差の対応関係を変化させる技術とが知られており、この2つにより、補正の精度を向上させ、対象物の位置検出の高精度化を目指している。 As described above, conventionally, as a technique for correcting distortion, a technique for accurately clarifying distortion occurring in a captured image and a technique for changing the correspondence of distortion according to the distance of an object are known. With these two, the accuracy of correction is improved, and the accuracy of position detection of the object is aimed at.
そして、歪曲収差補正に用いられる関数において、対象物の距離を計算する際のモデルとしては、従来、特許文献4、特許文献5等に開示されているように、対象物からの光束が必ずある一点を通過するといういわゆるピンホールモデルが適用されていた。
しかしながら、特許文献3等に記載の技術では、距離毎に異なる歪曲収差に対して、歪曲収差の補正曲線を複数持つことで対応する手法をとっており、補正を行う処理装置において大きなメモリ容量が必要となる他、内部の制御が複雑化するとの問題がある。
また、補正曲線が作成されていない部分に関しては、この部分を補間して処理する等の工夫が必要であり、制御が複雑化するとともに、補正の精度としても劣る原因となっている。
However, in the technique described in
Further, for the portion where the correction curve is not created, it is necessary to devise such as processing by interpolating this portion, which complicates the control and causes a poor correction accuracy.
また、特許文献3等に記載の技術では、例えば台の上に対象物を固定して撮像する場合であって、台から撮像装置までの距離が予め判明している場合には、予め距離に応じた歪曲収差の補正曲線を正確に作成することができるので、この補正曲線に基づいて補正することにより高精度の補正を行うことができる。台が上下に移動して台から撮像装置までの距離を変更可能な場合でも、各位置ごとの距離が判明していれば、同様に各位置に対応する補正曲線を予め作成しておくことができる。
しかし、一般的な撮像の場合には、対象物から撮像装置までの距離が分からない場合や、1つの画面の中に距離の異なる対象物が複数混在している場合が多く、このような場合には、特許文献3等に記載の技術では対応することができないとの問題もある。
Further, in the technique described in
However, in the case of general imaging, there are many cases where the distance from the object to the imaging device is not known, or there are many objects with different distances mixed in one screen. However, there is a problem that the technique described in
そこで、本発明は以上のような課題を解決するためになされたものであり、1つのモデルで距離による歪曲収差の変化に容易に対応可能であり、近距離から遠距離まで、様々な距離にある対象物の位置を高精度に検出することのできる位置検出装置及び位置検出方法を提供することを目的とするものである。 Therefore, the present invention has been made to solve the above-described problems, and it is possible to easily cope with a change in distortion due to distance with a single model, and at various distances from a short distance to a long distance. It is an object of the present invention to provide a position detection device and a position detection method that can detect the position of a certain object with high accuracy.
前記課題を解決するために、請求項1に記載の発明は、位置検出装置において、
光学系を備え対象物を撮像する複数の撮像手段により得られた対象物の結像面上の結像位置に関する実測値又は前記光学系に対する対象物の位置に関する位置関連情報に基づいて前記光学系に入射する光束と前記光学系の光軸との交点が前記光軸の延在方向に前後する交点変位モデルを適用して、前記撮像手段によって撮像された前記対象物の位置を検出する位置検出手段を備えていることを特徴としている。
In order to solve the above problem, the invention according to
The optical system based on actual measurement values on the imaging position of an object on the imaging plane obtained by a plurality of imaging means provided with an optical system and imaging the object or position related information on the position of the object with respect to the optical system Position detection for detecting the position of the object imaged by the imaging means by applying an intersection displacement model in which the intersection of the light beam incident on the optical system and the optical axis of the optical system is back and forth in the extending direction of the optical axis It is characterized by having means.
請求項2に記載の発明は、請求項1に記載の位置検出装置において、
前記位置検出手段は、カメラ座標を正規化して正規化座標を得る正規化変換処理を行う正規化手段と、前記正規化手段により正規化された後に前記複数の撮像手段のずれ補正処理を行うずれ補正手段と、を有し、
前記ずれ補正手段における前記ずれ補正処理において前記交点変位モデルを適用することを特徴とする。
The invention according to claim 2 is the position detection apparatus according to
The position detecting unit includes a normalizing unit that performs normalization conversion processing to obtain normalized coordinates by normalizing camera coordinates, and a shift that performs shift correction processing of the plurality of imaging units after being normalized by the normalizing unit. Correction means,
The intersection displacement model is applied in the deviation correction processing in the deviation correction means.
請求項3に記載の発明は、請求項1又は請求項2に記載の位置検出装置において、
前記交点変位モデルにおける係数を算出する係数算出手段をさらに備えていることを特徴とする。
The invention according to
Coefficient calculating means for calculating a coefficient in the intersection displacement model is further provided.
請求項4に記載の発明は、位置検出方法において、
光学系を備え対象物を撮像する複数の撮像手段により得られた対象物の結像面上の結像位置に関する実測値又は前記光学系に対する対象物の位置に関する位置関連情報に基づいて前記光学系に入射する光束と前記光学系の光軸との交点が前記光軸の延在方向に前後する交点変位モデルを適用して、前記撮像手段により撮像された前記対象物の位置を検出する位置検出工程を有することを特徴としている。
According to a fourth aspect of the present invention, in the position detection method,
The optical system based on actual measurement values on the imaging position of an object on the imaging plane obtained by a plurality of imaging means provided with an optical system and imaging the object or position related information on the position of the object with respect to the optical system Position detection for detecting the position of the object imaged by the imaging means by applying an intersection displacement model in which the intersection of the light beam incident on the optical system and the optical axis of the optical system is back and forth in the extending direction of the optical axis It has the process.
請求項5に記載の発明は、請求項4に記載の位置検出方法において、
前記位置検出工程は、カメラ座標を正規化して正規化座標を得る正規化変換処理を行う正規化工程と、前記正規化工程により正規化された後に前記複数の撮像手段のずれ補正処理を行うずれ補正工程と、を含み、前記ずれ補正工程において前記交点変位モデルを適用することを特徴とする。
The invention according to claim 5 is the position detection method according to claim 4,
The position detection step includes a normalization step of normalizing a camera coordinate to obtain a normalized coordinate, and a shift for performing a shift correction process of the plurality of imaging units after being normalized by the normalization step A correction step, wherein the intersection displacement model is applied in the deviation correction step.
請求項6に記載の発明は、請求項4又は請求項5に記載の位置検出方法において、
前記交点変位モデルにおける係数を算出する係数算出工程をさらに有することを特徴とする。
The invention according to claim 6 is the position detection method according to claim 4 or 5,
The method further includes a coefficient calculation step of calculating a coefficient in the intersection displacement model.
請求項1及び請求項4に記載の発明によれば、対象物の位置を検出する際に、光学系に入射する光束と光学系の光軸との交点が光軸の延在方向に前後する交点変位モデルを適用するので、対象物から撮像装置までの距離が分からない場合や、1つの画面の中に距離の異なる対象物が複数混在している場合でも1つのモデルで対応でき、対象物の位置検出を容易かつ高精度に行うことができるとの効果を奏する。 According to the first and fourth aspects of the invention, when detecting the position of the object, the intersection of the light beam incident on the optical system and the optical axis of the optical system moves back and forth in the extending direction of the optical axis. Since the intersection displacement model is applied, even if the distance from the object to the imaging device is not known, or when multiple objects with different distances are mixed in one screen, it can be handled with one model. The position detection can be easily and highly accurately performed.
請求項2及び請求項5に記載の発明によれば、対象物の位置を検出する工程を正規化処理を行う工程と、ずれ補正処理を行う工程とに分けて、ずれ補正処理を行う工程において交点変位モデルを適用するので、必要最小限の演算処理負担とすることができるとの効果を奏する。 According to the second and fifth aspects of the invention, in the step of performing the deviation correction process, the step of detecting the position of the object is divided into the step of performing the normalization process and the step of performing the deviation correction process. Since the intersection displacement model is applied, there is an effect that a necessary minimum processing load can be achieved.
請求項3及び請求項6に記載の発明によれば、交点変位モデルにおける係数を算出し、これを適用して対象物の位置を検出するので、対象物から撮像装置までの距離が分からない場合や、1つの画面の中に距離の異なる対象物が複数混在している場合でも対象物の位置検出を容易かつ高精度に行うことができるとの効果を奏する。 According to the third and sixth aspects of the present invention, since the coefficient in the intersection displacement model is calculated and applied to detect the position of the object, the distance from the object to the imaging device is not known. In addition, even when a plurality of objects having different distances are mixed in one screen, there is an effect that the position of the object can be detected easily and with high accuracy.
以下、図面を参照しながら本発明を実施するための最良の形態について説明する。ただし、本発明の範囲は以下の実施形態及び図示例に限定されるものではない。 The best mode for carrying out the present invention will be described below with reference to the drawings. However, the scope of the present invention is not limited to the following embodiments and illustrated examples.
[第1の実施形態]
図1から図9を参照しつつ、位置検出装置の第1の実施形態について説明する。
図1に示すように、本実施形態における位置検出装置1は、対象物(被写体)Pを撮像する2つの撮像装置2a,2bと、これらの撮像装置2a,2bによって取得された画像について画像処理を行い、当該画像の歪曲収差を補正するとともに対象物(被写体)の3次元上の位置を算出する画像処理部3を備えている。
[First Embodiment]
A first embodiment of the position detection device will be described with reference to FIGS. 1 to 9.
As illustrated in FIG. 1, the
各撮像装置2a,2bは、撮像素子(光電変換素子)21a,21bとこの撮像素子21a,21bの結像面25(図2及び図3参照)に被写体光像を結像させる光学系22a,22bとを備えている。撮像素子21a,21bは、例えばCCD(Charge Coupled Device)、CMOS(Complementary Metal-Oxide Semiconductor)等のイメージセンサであり、撮像素子21a,21bは、光学系22a,22bを透過した入射光を電気信号に光電変換して取り込むとともに、被写体光像を画像信号として画像処理部3に出力する。なお、光学系22a,22bは1つのレンズで構成されるものであってもよいし、複数のレンズで構成されるものでもよい。
Each of the
画像処理部3は、CPU(Central Processing Unit)等の処理装置、及び、システムプログラム、後述するキャリブレーション処理を行うためのキャリブレーションプログラム、対象物の位置を検出する位置検出処理を行う位置検出プログラム等、各種の制御プログラム等を格納するROM(Read Only Memory)、各種データを一時記憶するRAM(Random Access Memory)(いずれも図示せず)等の記憶部等を備えて構成されるコンピュータであり、画像の歪曲収差を補正するキャリブレーション処理及び対象物の位置を検出する位置検出処理を行うものである。
The
ここで、歪曲収差について、図2及び図3を参照しつつ説明する。なお、図2及び図3においては、画像が結像する撮像素子21の結像面25の図2及び図3における縦軸をx軸、横軸をy軸としている。また、図2においては、対象物Pからの光束が必ずある一点(図2の場合には光学系中心)を通過するという従来のピンホールモデルの場合を示している。
図2及び図3は、歪曲収差が生じていない場合の結像位置の座標(理想座標)を(x1,y1)とし、歪曲収差が生じている場合の現実の結像位置の座標(実座標)を(x2,y2)とし、光学系22の光軸が結像面25と交わる点を中心(x0,y0)としたときに、この中心(x0,y0)から座標(x1,y1)までの距離(理想の像高)を「rideal」とし、中心(x0,y0)から座標(x2,y2)までの距離(現実の像高)を「rreal」として表している。対象物Pを撮影した場合に得られる画像の歪曲収差は、理想の像高(rideal)と現実の像高(rreal)との比として表現することができ、下記式(1)により算出することができる。
歪曲収差=(rideal−rreal)/rideal×100(%) … (1)
Here, the distortion will be described with reference to FIGS. 2 and 3, the vertical axis in FIGS. 2 and 3 of the imaging surface 25 of the imaging element 21 on which an image is formed is the x axis and the horizontal axis is the y axis. FIG. 2 shows the case of a conventional pinhole model in which the light beam from the object P always passes through a certain point (in the case of FIG. 2, the center of the optical system).
2 and 3, the coordinates (ideal coordinates) of the imaging position when distortion is not generated are (x 1 , y 1 ), and the coordinates of the actual imaging position when distortion is occurring ( When the real coordinates are (x 2 , y 2 ) and the point where the optical axis of the optical system 22 intersects the image plane 25 is the center (x 0 , y 0 ), this center (x 0 , y 0 ) The distance from the center (x 0 , y 1 ) to the coordinates (x 1 , y 1 ) is “r ideal ”, and the distance from the center (x 0 , y 0 ) to the coordinates (x 2 , y 2 ) (actual image height) ) As “r real ”. The distortion aberration of an image obtained when the object P is photographed can be expressed as a ratio between an ideal image height (r ideal ) and an actual image height (r real ), and is calculated by the following equation (1). can do.
Distortion aberration = (r ideal −r real ) / r ideal × 100 (%) (1)
そして、図2に示すピンホールモデルによった場合には、この場合の理想座標(x1,y1)は、下記のように表すことができる。なお、下記において、Xは対象物PのX軸方向の距離、Yは対象物PのY軸方向の距離、Zは対象物Pから光学系中心までの距離である。
x1=f(X/Z),y1=f(Y/Z)
また、対象物Pから光学系22に入射する光の角度をθとすると、中心(x0,y0)から理想座標(x1,y1)までの距離(理想の像高)(rideal)は、下記式(2)のように表すことができる。
r=√(x2+y2)=ftanθ … (2)
In the case of using the pinhole model shown in FIG. 2, the ideal coordinates (x 1 , y 1 ) in this case can be expressed as follows. In the following, X is the distance in the X-axis direction of the object P, Y is the distance in the Y-axis direction of the object P, and Z is the distance from the object P to the center of the optical system.
x 1 = f (X / Z), y 1 = f (Y / Z)
Further, when the angle of light incident on the optical system 22 from the object P is θ, the distance (ideal image height) from the center (x 0 , y 0 ) to the ideal coordinates (x 1 , y 1 ) (r ideal ) Can be expressed as in the following formula (2).
r = √ (x 2 + y 2 ) = ftanθ (2)
また、対象物Pから光軸までの距離Rは、下記式(3)のように表すことができる。
R=√(X2+Y2) … (3)
Further, the distance R from the object P to the optical axis can be expressed as the following formula (3).
R = √ (X 2 + Y 2 ) (3)
このため、理想座標(x1,y1)は、下記のように表すことができる。
x1=r(X/R),y1=r(Y/R)
For this reason, ideal coordinates (x 1 , y 1 ) can be expressed as follows.
x 1 = r (X / R), y 1 = r (Y / R)
これに対して、本実施形態では、ピンホールモデルではなく、図3に示すように、光学系22を通して得られた対象物Pの結像面25上の結像位置に関する実測値又は光学系22に対する対象物Pの位置に関する位置関連情報に基づいて光学系22に入射する光束と光学系22の光軸との交点が光軸の延在方向に前後する交点変位モデルを適用する。すなわち、図3に示すように、光学系22に入射する光束は、光学系22の中心からk1だけ光軸の延在方向にずれた位置で光学系22の光軸と交わる。
なお、ここで対象物Pの結像面25上の結像位置に関する実測値とは、光学系22を通して得られた対象物Pの現実の結像位置の座標(実座標:x2,y2)又は光学系22の光軸が結像面25と交わる点(中心:x0,y0)から座標(x2,y2)までの距離(現実の像高:rreal)であり、光学系22に対する対象物Pの位置に関する位置関連情報とは、対象物PのX,Y座標、対象物Pから光学系中心までの距離Z、光学系中心から結像面25までの距離f、対象物Pからの光束が光学系22の光軸と交わる角度θ等である。
実際の光学系22においては、光学系22に入射する全ての光束を光学系22の中心を通過するように構成することが困難であり、歪曲収差の補正においても、光学系22に入射する光束と光学系22の光軸との交点が前後する交点変位モデルを適用することが現実に即している。
In contrast, in the present embodiment, instead of the pinhole model, as shown in FIG. 3, as shown in FIG. 3, measured values relating to the imaging position on the imaging surface 25 of the object P obtained through the optical system 22 or the optical system 22. Based on the position-related information regarding the position of the object P with respect to, an intersection displacement model is applied in which the intersection of the light beam incident on the optical system 22 and the optical axis of the optical system 22 is back and forth in the extending direction of the optical axis. That is, as shown in FIG. 3, the light beam incident on the optical system 22 intersects the optical axis of the optical system 22 at a position shifted from the center of the optical system 22 by k 1 in the extending direction of the optical axis.
Here, the actual measurement value relating to the imaging position of the object P on the imaging surface 25 is the coordinates of the actual imaging position of the object P obtained through the optical system 22 (actual coordinates: x 2 , y 2). ) Or a distance from the point (center: x 0 , y 0 ) where the optical axis of the optical system 22 intersects the imaging plane 25 to the coordinates (x 2 , y 2 ) (real image height: r real ) The position-related information regarding the position of the object P with respect to the system 22 includes the X and Y coordinates of the object P, the distance Z from the object P to the optical system center, the distance f from the optical system center to the imaging plane 25, the object The angle θ or the like at which the light beam from the object P intersects the optical axis of the optical system 22.
In the actual optical system 22, it is difficult to configure all the light beams incident on the optical system 22 so as to pass through the center of the optical system 22, and the light beams incident on the optical system 22 also in correcting distortion. It is practical to apply an intersection displacement model in which the intersection of the optical system 22 and the optical axis of the optical system 22 is back and forth.
このような交点変位モデルによった場合には、この場合の理想座標(x1,y1)は、下記のように表すことができる。
x1=((f+f(r))/(Z−f(r)))X,y1=((f+f(r))/(Z−f(r)))Y
ここで、f(r)は所定の係数をもつ関数である。なお、本実施形態では、交点変位モデルにおける関数f(r)として、後述のように、像高r(結像位置x,y)に応じて線形に変化するだけの関数(「k1r」)を適用する場合を例として説明する。なお、k1は係数である。
When such an intersection displacement model is used, the ideal coordinates (x 1 , y 1 ) in this case can be expressed as follows.
x 1 = ((f + f (r)) / (Z−f (r))) X, y 1 = ((f + f (r)) / (Z−f (r))) Y
Here, f (r) is a function having a predetermined coefficient. In the present embodiment, the function f (r) in the intersection displacement model is a function (“k 1 r”) that changes linearly according to the image height r (imaging position x, y) as described later. ) Will be described as an example. In addition, k 1 is a coefficient.
本実施形態において、画像処理部3は、この交点変位モデルを用いて理想値(理想座標、理想の像高)を取得するとともに、当該理想値に対応する仮定値(対象物Pの結像面25上の結像位置に関する歪曲収差を含んだ値)を取得するようになっている。
そして、画像処理部3は、実測値と仮定値とから交点変位モデルにおける係数k1、後述する歪曲収差モデルにおける係数(例えばα、β、γ)等を算出、特定するキャリブレーション処理を行い、その結果をRAM等の記憶部に記憶する。また、前記キャリブレーションの結果から、実施値を理想値に近づくように変換する補正処理を行う。
In the present embodiment, the
Then, the
具体的には、画像処理部3は、実測値(実座標、現実の像高)と仮定値とを比較して、実測値と仮定値とが所定の誤差範囲内にあるか否かを判定する。また、ROM等の記憶部には、この所定の誤差範囲内か否かを判定する際の閾値が予め記憶されている。
そして、画像処理部3は、実測値と仮定値とが所定の誤差範囲内にあると判定した場合には、理想値を導く際に仮決めした交点変位モデルにおける係数k1及び仮定値を導くために仮決めした歪曲収差モデルにおける係数を適正な係数と特定し、記憶部に記憶させるキャリブレーション処理を行う。なお、このように画像処理部3は、キャリブレーションの過程において、交点変位モデルにおける係数k1を算出、特定するものであり、画像処理部3は、係数算出手段として機能する。
そして、画像処理部3は、キャリブレーションの結果から、実測値を仮定値に対応する理想値に近似するように、画像に対して補正を行うようになっている。
Specifically, the
When the
Then, the
さらに、画像処理部3は、上記交点変位モデルを適用して、撮像手段2a,2bによって撮像された対象物Pの位置(3次元座標 図4におけるM(X,Y,Z))を検出する位置検出手段として機能する。
Furthermore, the
本実施形態において位置検出装置は、前述のように2つの撮像手段2a,2bを備えるステレオカメラであり、仮に2つの撮像手段2a,2bにずれがなく完全に平行であり、同一のものである場合には、図5に示す撮像手段2a,2bの焦点位置から対象物Pまでの距離Dは、下記の式(4)で表すことができる。なお、式(4)において、Bは撮像手段2a,2b間の距離(光学系22a,22bの光軸間の距離)であり、fは焦点距離であり、Cは視差を表す。
D=Bf/C … (4)
In the present embodiment, the position detection device is a stereo camera including the two
D = Bf / C (4)
しかし、現実には2つの撮像手段2a,2bが完全に平行であり、同一のものであることはほとんどなく、多少平行からずれてしまっているとか、撮像手段2aと撮像手段2bとで大きさ等が多少異なっている等の誤差がある。このため、対象物の位置を正確に検出するためには、撮像手段2aと撮像手段2bとの回転方向、横方向のずれを修正するずれ補正処理を行う必要がある。本実施形態では、画像処理部3は、これら撮像手段2a,2bのずれ補正処理を行うずれ補正手段として機能する。
However, in reality, the two image pickup means 2a and 2b are completely parallel and rarely the same, and are slightly deviated from parallel, or the image pickup means 2a and the image pickup means 2b are different in size. There are errors such as slightly different. For this reason, in order to accurately detect the position of the object, it is necessary to perform a shift correction process for correcting a shift in the rotational direction and the horizontal direction between the
また、実際の撮像装置2a,2bの結像面上における平面座標(カメラ座標)は、画素の横軸と縦軸の単位長が異なっていたり、縦軸と横軸のなす角度が直角になっていない場合がある。このため、予め、このカメラ座標を正規化して正規化座標を得る正規化変換処理を行う必要がある。本実施形態では、画像処理部3は、後述する変換行列によりカメラ座標を正規化座標に変換する正規化変換処理を行う正規化手段として機能する。
なお、本実施形態では、前記ずれ補正処理はこの正規化変換処理の後に行われるようになっており、このずれ補正処理において交点変換モデルが適用されるようになっている。
Further, in the plane coordinates (camera coordinates) on the imaging plane of the
In this embodiment, the deviation correction process is performed after the normalization conversion process, and the intersection transformation model is applied in the deviation correction process.
本実施形態において、対象物の3次元座標(対象物の3次元上の位置、図4におけるM(X,Y,Z))を検出する位置検出は、具体的には下記のような手法で行われる。 In the present embodiment, the position detection for detecting the three-dimensional coordinates of the object (the three-dimensional position of the object, M (X, Y, Z) in FIG. 4) is specifically performed by the following method. Done.
図4において、M(X,Y,Z)は、対象物Pの3次元座標であり、例えば、光学系中心を原点と見た場合の対象物Pの3次元位置をXYZ座標で表したものである。これに対して、m(x,y)は、撮像装置2a,2bの結像面25上に結像した対象物Pの被写体像の結像位置を2次元の座標で表したものである。なお、ここでは、実際の結像面25上での結像位置であるカメラ座標を後述する変換行列により変換し正規化した正規化座標をm(x,y)としている。
なお、以下の各式において、行列は斜字体の大文字で表記している(例えば、式(5)及び式(6)等におけるP)。
In FIG. 4, M (X, Y, Z) is the three-dimensional coordinates of the object P. For example, the three-dimensional position of the object P when the center of the optical system is viewed as the origin is represented by XYZ coordinates. It is. On the other hand, m (x, y) represents the imaging position of the subject image of the object P imaged on the imaging surface 25 of the
In the following equations, the matrix is written in italicized capital letters (for example, P in equation (5), equation (6), etc.).
また、本実施形態では、2つの撮像装置2a,2bが存するが、撮像装置2a,2bのうち、撮像装置2aを基準とし、撮像装置2aから見た撮像装置2bの座標を考えることにより、撮像装置2aの座標系,撮像装置2bの座標系という2つの座標系を1つに統合して処理を行う。
下記の各式においては、基準となる撮像装置2aについては、カンマを付さず、もう一方の撮像装置2bに関する各値についてはカンマを付する(例えばs(カンマ)、A(カンマ)、Pn(カンマ)、D(カンマ)等)ことにより、2つの撮像装置2a,2bの区別を図っている。なお、本実施形態では、以下撮像装置2aを基準とする場合を例として説明するが、複数の撮像装置2a,2bのうち、いずれを基準とするかは特に限定されない。
In the present embodiment, there are two
In each of the following formulas, the
この対象物Pの3次元座標M(X,Y,Z)と、被写体像の2次元座標m(x,y)との間の関係は、変換行列を介して対応付けることができ、下記式(5)及び式(6)のように表すことができる。なお、式(6)において、s(カンマ)、m(カンマ)、M(カンマ)は、これが撮像装置2bについての値であることを表す。また、式(5)及び式(6)において、s及びs(カンマ)は定数であり、Pは変換行列を表す(以下の各式において同じ)。また、式(5)及び式(6)において、ティルダを付したMは、対象物Pの3次元座標を同次座標で示したものであり、ティルダを付したmは、被写体像の結像位置を同次座標で示したものである(以下の各式において同じ)。
この変換行列Pを行列A、行列Pn、行列Dに分解すると、下記式(7)のように表すことができる。
ここで、行列Aは撮像手段2a,2bの内部の変数のみによって構成された内部行列であり、実際の結像面25上での結像位置であるカメラ座標を正規化した正規化座標m(x,y)に変換する正規化変換処理を行うための変換行列である。
また、行列Pnは、対象物Pの3次元座標M(X,Y,Z)と上記正規化後の被写体像の2次元座標m(x、y)との変換を行う変換行列(射影行列)であり、行列Dは、回転と移動(併進)を表す行列である。
Here, the matrix A is an internal matrix constituted only by variables inside the imaging means 2a and 2b, and normalized coordinates m () obtained by normalizing the camera coordinates that are the imaging positions on the actual imaging plane 25. It is a transformation matrix for performing a normalization transformation process for transformation into x, y).
The matrix P n is a transformation matrix (projection matrix) that performs transformation between the three-dimensional coordinates M (X, Y, Z) of the object P and the two-dimensional coordinates m (x, y) of the normalized subject image. The matrix D is a matrix that represents rotation and movement (translation).
正規化座標は、焦点距離が1、画素サイズが1、画素座標が直角となるような正規化カメラにより得られる2次元座標である。正規化カメラにおける対象物Pの3次元座標M(X,Y,Z)と被写体像の2次元座標m(x、y)との関係を表す射影行列Pnは、式(8)で表すことができる。これは先の式(7)の両辺に変換行列Aの逆行列を掛けたものであり、式(8)を変形すると式(9)となる。
さらに、この式(9)により、前記式(5)及び式(6)を変形すると、式(10)及び式(11)のようになる。
ここで、従来のピンホールモデルの場合には、射影行列Pnは、式(12)で表すことができる。
しかし、本実施形態においては、前述のように、係数k1rを持つ交点変位モデルを適用するため、射影行列Pnは、係数k1rを含んで式(13)及び式(14)のように表すことができる。ここで、rは、図4に示す座標中心(x0,y0)からm(x,y)までの距離である。なお、式(14)は撮像装置2bについてのものであるため、射影行列Pn及び係数k1rにカンマを付して撮像装置2aに関する式(13)と区別している。
本実施形態においては、前述のように、撮像装置2aを基準とするので、基準となる撮像装置2aについては回転及び移動をさせない。このため、撮像装置2aについての回転と移動を表す行列Dは式(15)となる。
他方、撮像装置2bの回転と移動を表す行列D(カンマ)は式(16)となる。なお、式(16)中、斜字体rは回転の各成分を表し、斜字体tは併進の各成分を表している。
これらの式を用いて、先述の式(5)及び式(6)を変換すると、行列B及びベクトルbを含む式(17)を導くことができる。なお、行列B及びベクトルbは、後述する式(18)及び式(19)に示すように、被写体像の2次元座標m(x、y)と関連付けられたものである。式(17)により、m(x,y)とM(X,Y,Z)とを一意に対応付けることができる。
ここで、式(17)における行列Bは、下記式(18)で表すことができ、ベクトルbは、下記式(19)で表すことができる。
ここで、式(19)における「k1」は、前記式(13)及び式(14)と同様、前記交点変位モデルにおける関数f(r)としての係数である。この係数は、画像処理部3によるキャリブレーション処理を通じて決定される。
Here, “k 1 ” in the equation (19) is a coefficient as the function f (r) in the intersection displacement model as in the equations (13) and (14). This coefficient is determined through calibration processing by the
ここで、斜字体pxxは、行列PnDの各要素であり、斜字体pxx(カンマ)は、行列PnD(カンマ)の各要素である。対象物Pの3次元座標M(X,Y,Z)は、下記式(20)で表すことができ、式(20)中の行列B及びベクトルbについて、式(18)及び式(19)を用いて展開することにより、対象物Pの3次元座標M(X,Y,Z)を求めることができる。
なお、式(20)において、行列B+は、(BTB)−1BTで表されるいわゆる擬似逆行列であり、Bの逆行列が求まらない場合でも、ある1つの行列を求めることができ、近似的な解を求めることができる。 In Equation (20), the matrix B + is a so-called pseudo inverse matrix represented by (B T B) −1 B T , and even when the inverse matrix of B cannot be obtained, An approximate solution can be obtained.
以下、図6から図8を参照しつつ、本実施形態における位置検出方法について説明する。 Hereinafter, the position detection method in the present embodiment will be described with reference to FIGS.
図6に示すように、本実施形態では、まず、画像処理部3によってキャリブレーション処理が行われる(ステップS1)。本実施形態では、このキャリブレーション処理の過程において、画像処理部3により係数「k1」が算出、決定される。
As shown in FIG. 6, in the present embodiment, first, calibration processing is performed by the image processing unit 3 (step S1). In the present embodiment, the coefficient “k 1 ” is calculated and determined by the
ここで、図7及び図8を参照しつつ、本実施形態におけるキャリブレーション処理について説明する。 Here, the calibration process in the present embodiment will be described with reference to FIGS.
まず、画像処理部3は、キャリブレーション用の対象物の3次元座標(X,Y,Z)を複数点取得する(ステップS11)。次に、画像処理部3は、前記交点変位モデルを適用して、当該対象物の各3次元座標から各座標に対応する理想値(理想座標:x1,y1)を算出する。具体的には、前記x1=((f+f(r))/(Z−f(r)))X,y1=((f+f(r))/(Z−f(r)))Yにおいて、係数k1とし、x1=((f+k1r)/(Z−k1r))X,y1=((f+k1r)/(Z−k1r))Yを求める(ステップS12)。なお、係数k1はこの段階では決定しないので、係数k1として適当な値を入れて理想座標(理想値)を仮決めする。
First, the
次に、画像処理部3は、歪曲収差モデルを適用して、ステップS12で仮決めされた各理想値に対応する仮定値(対象物の結像面25上の結像位置に関する歪曲収差を含んだ仮定的な座標)を求める(ステップS13)。具体的には、理想座標に対して、例えばαr2+βr4+γr6といった中心からの距離に応じて変化するような何らかの係数をもつ関数を適用する。なお、係数α、β、γはこの段階では決定しないので、係数α、β、γとして適当な値を入れてこれに対応する仮定値を求める(仮決めする)。
Next, the
そして、各仮定値が求められると、画像処理部3は、この仮定値と実測値(実座標:x2,y2)とを比較して(ステップS14)、全ての点について実測値と仮定値とが所定の誤差範囲内にあるか否かを判定する(ステップS15)。具体的には、画像処理部3は、実測値と仮定値との差分を算出し、算出された差分が記憶部に記憶されている閾値を超えているか否かを判断し、閾値を超えている場合には実測値と仮定値とが所定の誤差範囲内にないと判定する。なお、実測値(実座標:x2,y2)は、撮像素子21の結像面25上に実際に結像している画像のx,y座標から得ることができる。
When each hypothetical value is obtained, the
そして、実測値と仮定値とが所定の誤差範囲内にないと判定した場合(ステップS15;NO)には、画像処理部3は、交点変位モデルにおける係数k1、歪曲収差モデルにおける係数α、β、γを変更し(ステップS16)、係数の変更された各モデルで再度ステップ12からステップ15の処理を行い、実測値と仮定値とが所定の誤差範囲内となるまで同様に繰り返す。
なお、このような繰り返し演算においては、係数k1も係数α、β、γもある程度同列に扱うことができるので、係数α、β、γと係数k1という4つの係数を最適になるように適宜変更しながら演算を繰り返して最適な係数を探索するということが可能である。このような演算を行う手法としては、例えば、DLT(Direct Liner Transform Method)等を用いることができる。本実施形態において、演算を繰り返して最適な係数を探索する処理を係数算出処理とし、そのための工程を係数算出工程とする。
When it is determined that the actual measurement value and the assumed value are not within the predetermined error range (step S15; NO), the
In such an iterative operation, the coefficient k 1 and the coefficients α, β, and γ can be handled in the same row to some extent, so that the four coefficients α, β, γ, and the coefficient k 1 are optimized. It is possible to search for the optimum coefficient by repeating the calculation while appropriately changing. As a method for performing such calculation, for example, DLT (Direct Liner Transform Method) or the like can be used. In the present embodiment, a process for searching for an optimum coefficient by repeating the calculation is referred to as a coefficient calculation process, and a process for this is referred to as a coefficient calculation process.
他方、実測値と仮定値とが所定の誤差範囲内にあると判定した場合(ステップS15;YES)には、画像処理部3は、上記繰り返し演算により探索された最適な関数の係数を補正結果として記憶部に格納する(ステップS17)。なお、補正結果として記憶部に格納するのは関数の係数に限定されない。例えば、関数の係数の他に、実測値(実座標:x2,y2)と、仮定値又は仮定値に対応する理想値(理想座標:x1,y1)と、の対応関係を補正結果として記憶部に格納してもよい。
On the other hand, when it is determined that the actually measured value and the assumed value are within the predetermined error range (step S15; YES), the
画像の補正を行う場合には、図8に示すように、撮像装置2によって対象物Pを撮像し、撮像素子21上に投影される対象物Pの実測値(実座標:x2,y2)を取得する(ステップS21)。そして、画像処理部3は、上記図7のステップS11からステップS16によって得られ、記憶部に記憶されている補正結果を読み出して適用する。これにより、当該実測値(実座標:x2,y2)に対応する理想値(理想座標:x1,y1)が算出される。画像処理部3は、算出結果に基づいて対象物Pの各実測値(実座標:x2,y2)が、これに対応する理想値(理想座標:x1,y1)に近似するように、画像に対して補正を行い(ステップS22)、一連のキャリブレーション処理を終了する。
When correcting the image, as shown in FIG. 8, the object P is imaged by the imaging device 2 and measured values (actual coordinates: x 2 , y 2) of the object P projected onto the image sensor 21. ) Is acquired (step S21). Then, the
なお、従来のピンホールモデルを適用したキャリブレーション処理の場合には、例えば図9に示すように、キャリブレーション用の対象物の3次元座標(X,Y,Z)を複数点取得すると(ステップS31)、対象物Pからの光束が常に光学系22の一点を通過することを前提とするピンホールモデルを適用して、対象物の3次元座標から各座標に対応する理想値(理想座標:x1,y1)を求める(ステップS32)。なお、理想値(理想座標:x1,y1)は前記x1=f(X/Z),y1=f(Y/Z)で表される。
次に、歪曲収差モデルを適用して、ステップS32で求められた各理想値に対応する各仮定値(対象物Pの結像面25上の結像位置に関する歪曲収差を含んだ仮定的な座標)を求める(ステップS33)。仮定値をもとめる具体的手法は本実施形態のものと同様である。
そして、仮定値が求められると、この仮定値と実測値(実座標:x2,y2)とを比較して(ステップS34)、全ての点について実測値と仮定値とが所定の誤差範囲内にあるか否かを判定する(ステップS35)。判定の結果、実測値と仮定値とが所定の誤差範囲内にない場合(ステップS35;NO)には、歪曲収差モデルにおける係数α、β、γを変更し(ステップS36)、係数の変更された歪曲収差モデルで再度ステップ33からステップ35の処理を行い、実測値と仮定値とが所定の誤差範囲内となるまで同様に繰り返す。
In the case of calibration processing using a conventional pinhole model, for example, as shown in FIG. 9, when a plurality of three-dimensional coordinates (X, Y, Z) of a calibration object are acquired (step S31), applying a pinhole model on the premise that the light beam from the object P always passes through one point of the optical system 22, and ideal values (ideal coordinates: corresponding to each coordinate) from the three-dimensional coordinates of the object. x 1 , y 1 ) is obtained (step S32). The ideal values (ideal coordinates: x 1 , y 1 ) are expressed by the above x 1 = f (X / Z) and y 1 = f (Y / Z).
Next, by applying a distortion aberration model, each hypothetical value corresponding to each ideal value obtained in step S32 (a hypothetical coordinate including distortion aberration relating to the imaging position of the object P on the imaging surface 25). ) Is obtained (step S33). A specific method for obtaining the assumed value is the same as that in the present embodiment.
When the assumed value is obtained, the assumed value is compared with the actually measured value (actual coordinates: x 2 , y 2 ) (step S34), and the actually measured value and the assumed value for all points are within a predetermined error range. It is determined whether it is within (step S35). As a result of the determination, when the actually measured value and the assumed value are not within the predetermined error range (step S35; NO), the coefficients α, β, γ in the distortion aberration model are changed (step S36), and the coefficients are changed. The processing from step 33 to step 35 is performed again with the distortion aberration model, and the same is repeated until the actually measured value and the assumed value fall within a predetermined error range.
他方、実測値と仮定値とが所定の誤差範囲内にあると判定した場合(ステップS35;YES)には、画像処理部3は、上記繰り返し演算により探索された最適な関数の係数を補正結果として記憶部に格納する(ステップS37)。なお、補正結果として記憶部に格納するのは関数の係数に限定されない。例えば、実測値(実座標:x2,y2)と、仮定値又は仮定値に対応する理想値(理想座標:x1,y1)と、の対応関係を補正結果として記憶部に格納してもよい。
On the other hand, when it is determined that the actually measured value and the assumed value are within the predetermined error range (step S35; YES), the
なお、画像の補正を行う場合の処理は、前記図8において説明したものと同様であるので、説明を省略する。 Note that the processing for correcting an image is the same as that described with reference to FIG.
このように、従来のピンホールモデルを適用したキャリブレーション処理の場合には、対象物からの光束が常に光学系22の一点を通過することを前提としているので、対象物の位置等に関わらず理想値は確定されており、歪曲収差モデルにおける係数α、β、γのみを変更してキャリブレーション処理が行われる。
これに対して、本実施形態では、理想値も対象物Pの結像面25上の結像位置又は光学系22に対する対象物の位置に関する位置関連情報に基づいて変化することを前提としており、理想値を算出する交点変位モデルにおける係数k1と、仮定値を算出する歪曲収差モデルにおける係数α、β、γとをそれぞれ変更しながらキャリブレーション処理が行われる。
As described above, in the case of the calibration process using the conventional pinhole model, it is assumed that the light beam from the object always passes through one point of the optical system 22, and therefore, regardless of the position of the object or the like. The ideal value is fixed, and only the coefficients α, β, and γ in the distortion aberration model are changed and the calibration process is performed.
On the other hand, in the present embodiment, it is assumed that the ideal value also changes based on the image-related position on the imaging surface 25 of the object P or the position-related information regarding the position of the object with respect to the optical system 22. the coefficient k 1 at the intersection displacement model for calculating the ideal value, coefficients in the distortion model to calculate the assumed value alpha, beta, the calibration process while changing each and γ is performed.
次に、図6に戻り、画像処理部3は、前記式(7)等における内部行列(変換行列)Aを適用することにより、撮像装置2a,2bのカメラ座標を正規化して正規化座標を得る正規化変換処理を行う(ステップS2:正規化工程)。その後、画像処理部3は、式(7)等における射影行列Pn、回転と移動(併進)を表す行列Dを適用することにより、撮像手段2a,2bのずれ補正処理を行う(ステップS3:ずれ補正工程)。このずれ補正処理において、画像処理部3は、交点変位モデルを適用し、前記キャリブレーション処理において算出された係数k1を射影行列Pnに組み込んで演算を行う。
Next, returning to FIG. 6, the
そして、このように正規化変換処理、ずれ補正処理を行った上で、画像処理部3は、位置検出対象である対象物Pの位置(3次元座標 M(X,Y,Z))を検出する(ステップS4)。本実施形態において、位置検出工程は、ステップS2(正規化工程)及びステップS3(ずれ補正工程)を含むものである。
Then, after performing the normalization conversion process and the deviation correction process in this way, the
以上のように、本実施形態によれば、対象物Pの位置を検出する際に、光学系22に入射する光束と光学系22の光軸との交点が光軸の延在方向に前後する交点変位モデルを適用するので、対象物Pから撮像装置2a,2bまでの距離が分からない場合や、1つの画面の中に距離の異なる対象物Pが複数混在している場合でも1つのモデルで対応でき、対象物Pの位置検出を容易かつ高精度に行うことができる。
As described above, according to the present embodiment, when detecting the position of the object P, the intersection of the light beam incident on the optical system 22 and the optical axis of the optical system 22 moves back and forth in the extending direction of the optical axis. Since the intersection displacement model is applied, even when the distance from the object P to the
また、光学系22を通して得られた対象物Pの結像面25上の結像位置に関する実測値又は光学系22に対する対象物Pの位置に関する位置関連情報に基づいて光学系22に入射する光束と光学系22の光軸との交点が光軸の延在方向に前後する交点変位モデルを適用して理想値(理想座標:x1,y1)を算出する。このため、対象物Pの位置に応じて光学系22に入射する光束と光学系22の光軸との交点が変化しても、これに対応して正確な理想値(理想座標:x1,y1)を求めることができる。
そして、このようにして算出された理想値に対応する仮定値(歪曲収差を含んだ値)を算出し、これと実測値とを比較するので、対象物Pから光学系22までの距離が分からない場合や、1つの画面の中に距離の異なる対象物Pが複数混在している場合等でも、距離毎に異なる歪曲収差の補正曲線を用意することなく歪曲収差の変化に容易に対応することができ、対象物Pの距離に関わらず高精度の歪曲収差補正を行うことができる。
Further, a light beam incident on the optical system 22 based on an actual measurement value regarding the imaging position of the object P on the imaging surface 25 obtained through the optical system 22 or position-related information regarding the position of the object P with respect to the optical system 22. An ideal value (ideal coordinates: x 1 , y 1 ) is calculated by applying an intersection displacement model in which the intersection with the optical axis of the optical system 22 is back and forth in the extending direction of the optical axis. For this reason, even if the intersection of the light beam incident on the optical system 22 and the optical axis of the optical system 22 changes according to the position of the object P, the correct ideal value (ideal coordinates: x 1 , y 1 ) can be determined.
Then, an assumed value (a value including distortion) corresponding to the ideal value calculated in this way is calculated, and this is compared with an actual measurement value, so that the distance from the object P to the optical system 22 is known. Even when there is no object P or when there are a plurality of objects P having different distances on one screen, it is possible to easily cope with changes in distortion without preparing a correction curve for different distortion aberrations for each distance. Therefore, it is possible to correct distortion aberration with high accuracy regardless of the distance of the object P.
なお、本実施形態では、理想値(理想座標:x1,y1)を算出したら、まず歪曲収差モデルの関数を適用して仮定値を取得する場合を例として説明したが、処理の手順はここに例示したものに限定されない。例えば、実測値(実座標:x2,y2)を複数とり、これに対応する歪曲収差を算出することによって、図10に示すような対象物Pの像高に対応する歪曲収差を表すグラフ(例えば図10における実線)を作成し、これをαr2+βr4+γr6等、中心からの距離に応じて変化するような関数で置き換える(例えば図10における点線)。そして、このα、β、γという係数を繰り返し演算等で求めることによって、実際の歪曲収差に最も適合する係数を選択する手法を用いてもよい。 In the present embodiment, the ideal values (ideal coordinates: x 1 , y 1 ) are calculated, and the assumption value is first obtained by applying the function of the distortion aberration model. However, the processing procedure is as follows. It is not limited to what was illustrated here. For example, a graph representing the distortion aberration corresponding to the image height of the object P as shown in FIG. 10 by taking a plurality of actually measured values (actual coordinates: x 2 , y 2 ) and calculating the distortion aberration corresponding thereto. (For example, a solid line in FIG. 10) is created, and this is replaced with a function such as αr 2 + βr 4 + γr 6 that changes according to the distance from the center (for example, a dotted line in FIG. 10). A method may be used in which coefficients such as α, β, and γ are repeatedly calculated to select a coefficient that best matches the actual distortion aberration.
また、上記図10では、理想値よりも画像の中心(x0,y0)寄りにずれていく歪曲収差が現れる場合(歪曲収差の値がマイナスの値になる例)であって、その歪曲収差が画像の中心(x0,y0)から外側(像高が大きくなる方向)に行くに従って次第に大きくなっていく例(外側に行くに従って値が大きくなっていく例)を示しているが、歪曲収差の現れ方は光学系の構成等によって異なり、ここに例示したような変化となるとは限らない。
光学系によっては、画像の中心から外側に行くに従って歪曲収差が次第に大きくなるが、あるところまでいくと歪曲収差が小さくなっていくような変化を示す場合や、画像の中心から外側に行くに従って歪曲収差が次第に小さくなるような変化を示す場合もあり得る。また、画像の中心(x0,y0)から外側に行くに従って理想値よりも画像の中心(x0,y0)から離れる方向にずれていく歪曲収差が現れる場合(歪曲収差の値がプラスの値になる例)もあり得る。いずれの場合でも、本実施形態において説明した交点変位モデルを適用することができ、適切なキャリブレーション処理及び位置検出処理を行うことが可能である。
Further, in FIG. 10 above, there is a case where a distortion aberration that shifts closer to the center (x 0 , y 0 ) of the image than the ideal value appears (an example in which the distortion aberration value is a negative value). An example is shown in which the aberration gradually increases from the center (x 0 , y 0 ) of the image to the outside (the direction in which the image height increases) (an example in which the value increases as it goes to the outside). The appearance of distortion varies depending on the configuration of the optical system and the like, and does not always change as illustrated here.
Depending on the optical system, the distortion gradually increases from the center of the image to the outside, but when the distortion reaches a certain point, the distortion becomes small, or the distortion increases from the center of the image to the outside. There may be a case where the change gradually decreases. In addition, when distortion aberration that shifts away from the center (x 0 , y 0 ) from the ideal value as it goes outward from the center (x 0 , y 0 ) of the image appears (the value of distortion aberration is positive) There is also an example in which the value of In any case, the intersection displacement model described in this embodiment can be applied, and appropriate calibration processing and position detection processing can be performed.
また、本実施形態においては、交点変位モデルにおける関数f(r)として、像高r(結像位置x,y)に応じて線形に変化するだけのもの(「k1r」)を用いた例を示したが、交点変位モデルにおける関数はこれに限定されない。 Further, in the present embodiment, the function f (r) in the intersection displacement model is a function that changes only linearly according to the image height r (imaging position x, y) (“k 1 r”). Although an example is shown, the function in the intersection displacement model is not limited to this.
例えば、交点変位モデルにおける関数f(r)として、下記のような関数を用いるものでもよい。
x=((f+(k1r+k1r2+…))/(Z−(k1r+k1r2+…)))X,y=((f+(k1r+k1r2+…))/(Z−(k1r+k1r2+…)))Y
このような関数を用いた場合には、例えばrが大きくなるのに応じて途中までは次第に値が大きくなるが、あるところから値が小さくなっていく場合や、値が大きくなる場合も少しずつ大きくなるのではなく、rの二乗に比例するように急激に大きくなる場合等、様々なモデルにも対応できる。
For example, the following function may be used as the function f (r) in the intersection displacement model.
x = ((f + (k 1 r + k 1 r 2 +...)) / (Z− (k 1 r + k 1 r 2 +...))) X, y = ((f + (k 1 r + k 1 r 2 +...)) / (Z− (k 1 r + k 1 r 2 +...))) Y
When such a function is used, for example, as r increases, the value gradually increases partway through, but when the value decreases from a certain point or when the value increases, little by little. It is possible to deal with various models such as a case where it does not increase but increases rapidly in proportion to the square of r.
また、例えば、下記のような関数を用いるものでもよい。
x=((f+k1θ)/(Z−k1θ))X,y=((f+k1θ)/(Z−k1θ))Y
これは、像高rといったx,y座標ではなく、対象物Pから光学系22に入射する角度θで式を表現したものである。x,y座標と角度θとは相互に対応関係があるため、θが確定すればx,y座標も確定させることができる。
対象物Pから光学系22に入射する光束の角度に対して、一般に理想値(理想の結像位置)は、図11(a)に示すように、ftanθで表すことができる。しかし、例えば、光学系22として180度程度の広角レンズを用いて撮影を行う場合には、図11(b)に示すように、対象物Pからの光束がほぼ180度近い角度で光学系22に入射してくることにより、結像位置はかなり遠いところになってしまうため、結像位置がfθで表されるのが一般的である。このような場合には、結像位置で示したのではモデルとしての現実性が乏しいため、結像位置ではなく角度θで示すことが有効である。角度θで示すと、入射側の角度が180度なら、出射側の角度も180度となるため容易に表すことができる。このため、特に広角レンズを用いた場合等には、角度θに応じて線形に変化していくという、上記の関数モデルが好適に適合する。
For example, the following functions may be used.
x = ((f + k 1 θ) / (Z−k 1 θ)) X, y = ((f + k 1 θ) / (Z−k 1 θ)) Y
This expresses the equation not by the x and y coordinates such as the image height r but by the angle θ incident on the optical system 22 from the object P. Since the x and y coordinates and the angle θ have a corresponding relationship with each other, the x and y coordinates can be determined once θ is determined.
In general, an ideal value (ideal imaging position) with respect to the angle of the light beam incident on the optical system 22 from the object P can be expressed by f tan θ as shown in FIG. However, for example, when photographing is performed using a wide-angle lens of about 180 degrees as the optical system 22, the optical system 22 is at an angle that the light flux from the object P is almost 180 degrees as shown in FIG. Since the image forming position is considerably distant by being incident on, the image forming position is generally represented by fθ. In such a case, since it is not realistic as a model if it is shown at the imaging position, it is effective to show it at the angle θ instead of the imaging position. In terms of the angle θ, if the angle on the incident side is 180 degrees, the angle on the exit side is also 180 degrees, which can be expressed easily. For this reason, especially when a wide-angle lens is used, the above-mentioned function model that changes linearly according to the angle θ is suitably adapted.
さらに、例えば、下記のように対象物Pの位置が分かっているものについては、その位置に応じて変化する関数モデルを用いることも可能である。
x=((f+k1(R/Z))/(Z−k1(R/Z)))X,y=((f+k1(R/Z))/(Z−k1(R/Z)))Y
なお、交点変位モデルに適用される関数モデルはここに示したものに限定されるものではなく、適宜変形可能である。
Furthermore, for example, for the case where the position of the object P is known as described below, a function model that changes in accordance with the position can be used.
x = ((f + k 1 (R / Z)) / (Z−k 1 (R / Z))) X, y = ((f + k 1 (R / Z)) / (Z−k 1 (R / Z)) )) Y
The function model applied to the intersection displacement model is not limited to the one shown here, and can be modified as appropriate.
また、本実施形態では、位置検出方法における正規化変換処理、ずれ補正処理及び係数算出処理をすべて画像処理部3で行う場合を例として説明したが、このように1つの機能部ですべての処理を行う場合に限定されず、複数の機能部でそれぞれの処理を行うようにしてもよい。また、位置検出処理の際に適用される係数は、位置検出装置内で算出される場合に限定されず、例えば、外部装置で算出された係数を用いて、位置検出装置の画像処理部が位置検出処理を行ってもよい。
In the present embodiment, the case where the normalization conversion process, the shift correction process, and the coefficient calculation process in the position detection method are all performed by the
また、本実施形態において、キャリブレーション処理を行う際のキャリブレーション用の対象物の画像を撮像装置2a,2bにより取得する場合を例として説明したが、キャリブレーションを行う対象である画像データを外部から入力可能としてもよい。また、位置検出装置を撮像装置とは別体で構成されていてもよい。この場合には、位置検出装置は、外部から取得した画像データに基づいて対象物の位置を検出する位置検出処理を行う。
Further, in the present embodiment, the case where the image of the object for calibration at the time of performing the calibration process is acquired by the
その他、本発明が上記実施形態に限らず適宜変更可能であるのは勿論である。 In addition, it is needless to say that the present invention is not limited to the above embodiment and can be modified as appropriate.
[第2の実施形態]
次に、図12及び図13を参照しつつ、本発明に係る位置検出装置及び位置検出方法の第2の実施形態について説明する。なお、第2の実施形態における位置検出装置は第1の実施形態と同様の画像処理部(図示せず)を備えており、位置検出方法は、この画像処理部によって実行されるものであり、係数k1を取得するキャリブレーション処理の手順のみが第1の実施形態と異なるものであるため、以下においては、特に第1の実施形態と異なる点について説明する。なお、装置構成は第1の実施形態と同様であるため、その説明を省略する。
[Second Embodiment]
Next, a second embodiment of the position detection device and the position detection method according to the present invention will be described with reference to FIGS. The position detection device in the second embodiment includes an image processing unit (not shown) similar to that in the first embodiment, and the position detection method is executed by the image processing unit. Since only the procedure of the calibration process for acquiring the coefficient k 1 is different from that of the first embodiment, the following description will particularly focus on differences from the first embodiment. The apparatus configuration is the same as that of the first embodiment, and a description thereof will be omitted.
本実施形態における位置検出方法では、第1の実施形態と同様に、まず、キャリブレーション処理を行って係数k1を算出する。図9を参照しつつ、本実施形態におけるキャリブレーション処理について説明する。 In the position detection method in this embodiment, as in the first embodiment, firstly, it calculates a coefficient k 1 by performing the calibration process. The calibration process in the present embodiment will be described with reference to FIG.
図9に示すように、対象物の距離に応じた歪曲収差(実測値)を予め対象物の距離毎に取得(測定)する(ステップS41)。
図9は、取得された距離ごとの歪曲収差(実測値)をプロットし、グラフに表したものである。そして、その中からある任意の距離(例えば、対象物Pの距離が0.3mである場合)を代表距離として選択する(ステップS42)。そして、この代表距離における歪曲収差(実測値)について、第1の実施形態で示したのと同様の手法により歪曲収差モデル(例えば、αr2+βr4+γr6)の係数(例えば前記関数の場合には、係数α、β、γ)を決定する(ステップS43)。
As shown in FIG. 9, distortion (measured value) corresponding to the distance of the object is acquired (measured) in advance for each distance of the object (step S41).
FIG. 9 is a graph plotting distortion aberrations (actual measurement values) for each acquired distance. Then, an arbitrary distance (for example, when the distance of the object P is 0.3 m) is selected as the representative distance (step S42). For the distortion aberration (actually measured value) at this representative distance, a coefficient (for example, αr 2 + βr 4 + γr 6 ) of a distortion aberration model (for example, αr 2 + βr 4 + γr 6 ) is obtained by the same method as that shown in the first embodiment. Determines the coefficients α, β, γ) (step S43).
次に、代表距離の歪曲収差に対して、第1の実施形態と同様の交点変位モデルを適用して、光学系22に入射する光束と光学系22の光軸との交点が光軸の延在方向に前後することを考慮に入れた場合に距離ごとの歪曲収差(仮定値)がどのようになるかを算出する(ステップS44)。なお、対象物Pの距離の差分を計算することによって、代表距離(例えば、対象物Pの距離が0.3m)の場合の歪曲収差(仮定値)から、対象物Pの距離が0.5mの場合の歪曲収差(仮定値)、0.7mの場合の歪曲収差(仮定値)、0.9mの場合の歪曲収差(仮定値)…をそれぞれ算出することが可能である。
この段階では、交点変位モデルの係数(例えば、第1の実施形態の場合の係数k1)は決定できないので、適当な値を係数k1と仮決めして演算を行う。
Next, an intersection displacement model similar to that of the first embodiment is applied to the distortion at the representative distance, and the intersection of the light beam incident on the optical system 22 and the optical axis of the optical system 22 is the extension of the optical axis. It is calculated what the distortion aberration (assumed value) for each distance becomes when the back-and-forth movement is taken into consideration (step S44). Note that by calculating the difference in the distance of the object P, the distance of the object P is 0.5 m from the distortion (assumed value) in the case of the representative distance (for example, the distance of the object P is 0.3 m). It is possible to calculate the distortion aberration (assumed value) in the case of 0.7, the distortion aberration (assumed value) in the case of 0.7 m, the distortion aberration (assumed value) in the case of 0.9 m, respectively.
At this stage, since the coefficient of the intersection displacement model (for example, the coefficient k 1 in the first embodiment) cannot be determined, an appropriate value is temporarily determined as the coefficient k 1 and the calculation is performed.
そして、ステップS41において取得した距離ごとの歪曲収差(実測値)と、交点変位モデルを適用して求めた距離ごとの歪曲収差(仮定値)とを比較し(ステップS45)、実測値と仮定値とが所定の誤差範囲内にあるか否かを判定する(ステップS46)。具体的には、実測値と仮定値との差分を算出し、算出された差分が記憶部に記憶されている閾値を超えているか否かを判断し、閾値を超えている場合には実測値と仮定値とが所定の誤差範囲内にないと判定される。 Then, the distortion aberration (measured value) for each distance acquired in step S41 is compared with the distortion aberration (assumed value) for each distance obtained by applying the intersection displacement model (step S45), and the measured value and the assumed value are compared. Are within a predetermined error range (step S46). Specifically, the difference between the actually measured value and the assumed value is calculated, and it is determined whether or not the calculated difference exceeds the threshold value stored in the storage unit. And the assumed value are not within the predetermined error range.
そして、実測値と仮定値とが所定の誤差範囲内にないと判定した場合(ステップS46;NO)には、交点変位モデルにおける係数k1を変更し(ステップS47)、係数の変更されたモデルで再度ステップ43からステップ46の処理を行い、実測値と仮定値とが所定の誤差範囲内となるまで同様に繰り返す。本実施形態において、演算を繰り返して最適な係数を探索する処理を係数算出処理とし、そのための工程を係数算出工程とする。 The case where the measured value and the assumed value is determined not within the predetermined error range; (step S46 NO), change the coefficient k 1 at the intersection displacement model (step S47), coefficients of the modified model Then, the processing from step 43 to step 46 is performed again, and the same is repeated until the actually measured value and the assumed value are within the predetermined error range. In the present embodiment, a process for searching for an optimum coefficient by repeating the calculation is referred to as a coefficient calculation process, and a process for the process is referred to as a coefficient calculation process.
他方、実測値と仮定値とが所定の誤差範囲内にあると判定した場合(ステップS46;YES)には、画像処理部は、上記繰り返し演算により探索された最適な関数の係数を補正結果として記憶部に格納する(ステップS48)。なお、補正結果として記憶部に格納するのは関数の係数に限定されない。例えば、実測値(実測上の歪曲収差)と、仮定値(計算上の歪曲収差)との対応関係を補正結果として記憶部に格納してもよい。 On the other hand, when it is determined that the actually measured value and the assumed value are within the predetermined error range (step S46; YES), the image processing unit uses the coefficient of the optimum function searched by the above repetitive calculation as the correction result. Store in the storage unit (step S48). Note that storing the correction result in the storage unit is not limited to the coefficient of the function. For example, the correspondence between the actually measured value (measured distortion aberration) and the assumed value (calculated distortion aberration) may be stored in the storage unit as a correction result.
なお、画像の補正を行う場合の処理は、第1の実施形態の図8において説明したものと同様であるので、説明を省略する。 Note that the processing for correcting an image is the same as that described in FIG. 8 of the first embodiment, and thus the description thereof is omitted.
そして、画像処理部は、キャリブレーション処理において算出された係数k1を用いて、対象物の位置を検出する位置検出処理を行う。具体的は、第1の実施形態と同様に、まず、撮像装置のカメラ座標を正規化して正規化座標を得る正規化変換処理を行う(正規化工程)。その後、画像処理部は、係数k1を含んだ交点変位モデルを適用して撮像手段のずれ補正処理を行い(ずれ補正工程)、対象物の位置を検出する。 Then, the image processing unit, using the coefficient k 1 calculated in the calibration process, performs the position detecting process for detecting the position of the object. Specifically, as in the first embodiment, first, normalization conversion processing is performed to obtain normalized coordinates by normalizing the camera coordinates of the imaging apparatus (normalization step). Thereafter, the image processing unit performs error correcting process of the image pickup means by applying an intersection displacement model including the coefficients k 1 (deviation correcting step), to detect the position of the object.
以上のように、本実施形態によれば、交点変位モデルを適用することにより距離ごとの仮定値を取得するので、対象物から撮像装置までの距離が分からない場合や、1つの画面の中に距離の異なる対象物が複数混在している場合でも容易に高精度の歪曲収差補正を行うことができる。
また、キャリブレーション処理の過程で得られた交点変位モデルの係数k1を用いて撮像手段間のずれ補正処理を行い、対象物の位置を検出するので、従来のピンホールモデルを適用する場合と比べて、より柔軟で精度の高い位置検出を行うことができる。
As described above, according to the present embodiment, the assumed value for each distance is acquired by applying the intersection displacement model, so that the distance from the object to the imaging device is not known or in one screen Even when a plurality of objects having different distances are mixed, highly accurate distortion correction can be easily performed.
Also performs deviation correction processing between the image pickup means using the coefficient k 1 of the intersection displacement model obtained in the course of the calibration process, and detects the position of the object, when applying the conventional pinhole model and Compared to this, it is possible to perform position detection that is more flexible and accurate.
なお、本発明が上記実施の形態に限らず適宜変更可能であるのは第1の実施形態と同様である。 It is to be noted that the present invention is not limited to the above-described embodiment, but can be changed as appropriate as in the first embodiment.
1 位置検出装置
2a,2b 撮像装置
21a,21b 撮像素子
22a,22b 光学系
3 画像処理部
25 結像面
P 対象物
DESCRIPTION OF
Claims (6)
前記ずれ補正手段における前記ずれ補正処理において前記交点変位モデルを適用することを特徴とする請求項1に記載の位置検出装置。 The position detecting unit includes a normalizing unit that performs normalization conversion processing to obtain normalized coordinates by normalizing camera coordinates, and a shift that performs shift correction processing of the plurality of imaging units after being normalized by the normalizing unit. Correction means,
The position detection apparatus according to claim 1, wherein the intersection displacement model is applied in the shift correction processing in the shift correction unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007145122A JP2008298589A (en) | 2007-05-31 | 2007-05-31 | Device and method for detecting positions |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007145122A JP2008298589A (en) | 2007-05-31 | 2007-05-31 | Device and method for detecting positions |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008298589A true JP2008298589A (en) | 2008-12-11 |
Family
ID=40172239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007145122A Pending JP2008298589A (en) | 2007-05-31 | 2007-05-31 | Device and method for detecting positions |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008298589A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011058876A1 (en) * | 2009-11-13 | 2011-05-19 | 富士フイルム株式会社 | Distance measuring device, distance measuring method, distance measuring program, distance measuring system, and image capturing device |
CN103165492A (en) * | 2013-04-03 | 2013-06-19 | 北京信息科技大学 | Optical microscopic image detection method for TSV (through silicon vias) of wafer |
US9658056B2 (en) | 2014-04-03 | 2017-05-23 | Canon Kabushiki Kaisha | Projection apparatus for measurement system based on exit pupil positions |
JP2018017568A (en) * | 2016-07-27 | 2018-02-01 | キヤノン株式会社 | Distance measurement device, imaging device and distance measurement method |
CN111131801A (en) * | 2018-11-01 | 2020-05-08 | 华勤通讯技术有限公司 | Projector correction system and method and projector |
JP2021056234A (en) * | 2020-12-08 | 2021-04-08 | 日立Astemo株式会社 | Stereo camera |
-
2007
- 2007-05-31 JP JP2007145122A patent/JP2008298589A/en active Pending
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011058876A1 (en) * | 2009-11-13 | 2011-05-19 | 富士フイルム株式会社 | Distance measuring device, distance measuring method, distance measuring program, distance measuring system, and image capturing device |
CN102597693A (en) * | 2009-11-13 | 2012-07-18 | 富士胶片株式会社 | Distance measuring device, distance measuring method, distance measuring program, distance measuring system, and image capturing device |
JP5214811B2 (en) * | 2009-11-13 | 2013-06-19 | 富士フイルム株式会社 | Ranging device, ranging method, ranging program, ranging system and imaging device |
US8654195B2 (en) | 2009-11-13 | 2014-02-18 | Fujifilm Corporation | Distance measuring apparatus, distance measuring method, distance measuring program, distance measuring system, and image pickup apparatus |
CN102597693B (en) * | 2009-11-13 | 2015-04-01 | 富士胶片株式会社 | Distance measuring device, distance measuring method, distance measuring program, distance measuring system, and image capturing device |
CN103165492A (en) * | 2013-04-03 | 2013-06-19 | 北京信息科技大学 | Optical microscopic image detection method for TSV (through silicon vias) of wafer |
CN103165492B (en) * | 2013-04-03 | 2015-11-18 | 北京信息科技大学 | The optical microscopic image detection method of a kind of TSV of wafer |
US9658056B2 (en) | 2014-04-03 | 2017-05-23 | Canon Kabushiki Kaisha | Projection apparatus for measurement system based on exit pupil positions |
JP2018017568A (en) * | 2016-07-27 | 2018-02-01 | キヤノン株式会社 | Distance measurement device, imaging device and distance measurement method |
CN111131801A (en) * | 2018-11-01 | 2020-05-08 | 华勤通讯技术有限公司 | Projector correction system and method and projector |
JP2021056234A (en) * | 2020-12-08 | 2021-04-08 | 日立Astemo株式会社 | Stereo camera |
JP7083014B2 (en) | 2020-12-08 | 2022-06-09 | 日立Astemo株式会社 | Stereo camera |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10958892B2 (en) | System and methods for calibration of an array camera | |
JP5075757B2 (en) | Image processing apparatus, image processing program, image processing method, and electronic apparatus | |
JP6663040B2 (en) | Depth information acquisition method and apparatus, and image acquisition device | |
JP5997645B2 (en) | Image processing apparatus and method, and imaging apparatus | |
JP5074322B2 (en) | Image processing apparatus, image processing method, image processing program, and imaging apparatus | |
US7965325B2 (en) | Distortion-corrected image generation unit and distortion-corrected image generation method | |
WO2018029950A1 (en) | Calibration device, calibration method, optical device, imaging device and projection device | |
US20130124159A1 (en) | Methods and Apparatus for Retargeting and Prioritized Interpolation of Lens Profiles | |
JP2012026841A (en) | Stereo distance measuring equipment and stereo distance measuring method | |
JP6429444B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
JP4055998B2 (en) | Distance detection device, distance detection method, and distance detection program | |
US20180033121A1 (en) | Image processing apparatus, image processing method, and storage medium | |
WO2014171304A1 (en) | Imaging device, imaging device drive method, and imaging device control program | |
JP2008298589A (en) | Device and method for detecting positions | |
JP2012050013A (en) | Imaging apparatus, image processing device, image processing method, and image processing program | |
JP2012147281A (en) | Image processing apparatus | |
US20190297267A1 (en) | Control apparatus, image capturing apparatus, control method, and storage medium | |
JP6628678B2 (en) | Distance measuring device, imaging device, and distance measuring method | |
JP5446285B2 (en) | Image processing apparatus and image processing method | |
US10339665B2 (en) | Positional shift amount calculation apparatus and imaging apparatus | |
JP6755737B2 (en) | Distance measuring device, imaging device, and distance measuring method | |
JP6680335B2 (en) | Stereo camera, vehicle, calculation method and program | |
JP2008286548A (en) | Calibration method | |
JP2010041416A (en) | Image processing unit, image processing method, image processing program, and imaging apparatus | |
JP2018200268A (en) | Image recognition device |