JP6571948B2 - Information processing apparatus, information processing method, and program - Google Patents
Information processing apparatus, information processing method, and program Download PDFInfo
- Publication number
- JP6571948B2 JP6571948B2 JP2015033366A JP2015033366A JP6571948B2 JP 6571948 B2 JP6571948 B2 JP 6571948B2 JP 2015033366 A JP2015033366 A JP 2015033366A JP 2015033366 A JP2015033366 A JP 2015033366A JP 6571948 B2 JP6571948 B2 JP 6571948B2
- Authority
- JP
- Japan
- Prior art keywords
- label
- pattern
- unit
- pixel
- information 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
Links
Images
Description
本発明は、カメラとプロジェクタの対応関係を求める技術に関する。 The present invention relates to a technique for obtaining a correspondence relationship between a camera and a projector.
プロジェクタからパターン光を計測対象物体に投影し、その反射光を撮像装置が観測することで、投影座標と撮像座標の対応を取得し、三角測量の原理によって三次元座標を求める三次元計測装置が広く知られている。パターン光を投影し、反射光を観測する三次元計測手法では、拡散反射率が低い黒色物体や金属物体が計測対象物体である場合、反射光が小さくパターン光の観測輝度が低下してしまう。そのため、ショットノイズなどのノイズの影響を大きく受け、精度良く投影座標と撮像座標の対応を求めることができないため、三次元計測精度が悪化する。 Projecting pattern light from the projector onto the object to be measured and observing the reflected light by the imaging device, the correspondence between the projected coordinate and the imaging coordinate is obtained, and the 3D measurement device that obtains the 3D coordinate by the principle of triangulation Widely known. In the three-dimensional measurement method of projecting pattern light and observing reflected light, when a black object or metal object having a low diffuse reflectance is a measurement target object, the reflected light is small and the observation brightness of the pattern light is lowered. Therefore, it is greatly affected by noise such as shot noise, and the correspondence between the projection coordinates and the imaging coordinates cannot be obtained with high accuracy, so that the three-dimensional measurement accuracy is deteriorated.
この問題に対処する方法のひとつに、特許文献1では、特定のパターンの露光時間を長くすることによって、観測輝度を高め、ノイズの影響を低減している。また、非特許文献2では、プロジェクタが出力する光の広がり方を狭め、パターン光の照度を大きくし、高精度な計測に必要な観測輝度を得ている。
As one method for dealing with this problem,
しかしながら、特許文献1の手法では、しかし、露光時間を長くするため、計測時間がかかるという課題がある。。また、非特許文献1の手法では、パターン光が投影される範囲が狭まるため、計測範囲が狭まるという課題がある。
However, the method of
本発明は上記問題に鑑みてなされたものであり、パターンが投影された対象物体の観測輝度が小さくてノイズの影響を受ける場合でも、高精度に投影座標と撮像座標の対応を求めることを目的とする。 The present invention has been made in view of the above problems, and an object of the present invention is to obtain a correspondence between a projection coordinate and an imaging coordinate with high accuracy even when the observation luminance of a target object onto which a pattern is projected is small and affected by noise. And
上記課題を解決するために、本発明の情報処理装置は、例えば、投影手段により明部と暗部とを有する複数種類のパターンが時系列に投影された対象物体を撮像した複数の画像を取得する画像取得手段と、前記複数の画像における画素に対して、該画素の輝度に応じたラベルを付与する付与手段と、前記投影される複数種類のパターンのうちのある1つのパターンにおける明部と暗部との境界が発生する位置では、他のパターンにおいて前記境界が発生しない制約に基づいて、前記付与されたラベルを変更する変更手段と、前記変更されたラベルに基づいて、前記投影手段の投影面における前記パターンの位置と、前記取得された画像における前記パターンの位置との対応関係を導出する対応関係導出手段と備える。 In order to solve the above-described problem, the information processing apparatus according to the present invention acquires , for example, a plurality of images obtained by capturing a target object in which a plurality of types of patterns having a bright part and a dark part are projected in time series by a projection unit. An image acquisition unit; an applying unit that applies a label corresponding to the luminance of the pixel to pixels in the plurality of images; and a bright portion and a dark portion in one of the plurality of projected patterns And a changing unit that changes the assigned label based on a constraint that the boundary does not occur in another pattern, and a projection plane of the projection unit based on the changed label. And a correspondence relationship deriving unit for deriving a correspondence relationship between the position of the pattern and the position of the pattern in the acquired image.
本発明によれば、パターンが投影された対象物体の観測輝度が小さくてノイズの影響を受ける場合でも、高精度に投影座標と撮像座標の対応を求めることができる。 According to the present invention, even when the observation brightness of the target object onto which the pattern is projected is small and affected by noise, the correspondence between the projection coordinates and the imaging coordinates can be obtained with high accuracy.
以下、本発明にかかる実施形態の情報処理装置を詳細に説明する。 Hereinafter, an information processing apparatus according to an embodiment of the present invention will be described in detail.
本発明にかかる実施形態を説明するのに先立ち、各実施形態に示す情報処理装置が実装されるハードウェア構成について、図23を用いて説明する。 Prior to describing the embodiments according to the present invention, a hardware configuration in which the information processing apparatus shown in each embodiment is mounted will be described with reference to FIG.
図23は、本実施形態における情報装置のハードウェア構成図である。同図において、CPU2310は、バス2300を介して接続する各デバイスを統括的に制御する。CPU2310は、読み出し専用メモリ(ROM)2320に記憶された処理ステップやプログラムを読み出して実行する。オペレーティングシステム(OS)をはじめ、本実施形態に係る各処理プログラム、デバイスドライバ等はROM2320に記憶されており、ランダムアクセスメモリ(RAM)2330に一時記憶され、CPU2310によって適宜実行される。また、入力I/F2340は、外部の装置(表示装置や操作装置など)から情報処理装置1で処理可能な形式で入力信号として入力する。また、出力I/F2350は、外部の装置(表示装置)へ表示装置が処理可能な形式で出力信号として出力する。
FIG. 23 is a hardware configuration diagram of the information device according to the present embodiment. In the figure, a
これらの各機能部は、CPU2310が、ROM2320に格納されたプログラムをRAM2330に展開し、後述する各フローチャートに従った処理を実行することで実現されている。また例えば、CPU2310を用いたソフトウェア処理の代替としてハードウェアを構成する場合には、ここで説明する各機能部の処理に対応させた演算部や回路を構成すればよい。
Each of these functional units is realized by the
(第1の実施形態)
第1の実施形態の情報処理装置は、投影したグレイコードパターン群の構造的特徴に基づき、ノイズの影響を受けて発生した計測対象領域の識別誤りを訂正、決定することで、高精度な三次元座標を算出できるようにしたものである。
(First embodiment)
The information processing apparatus according to the first embodiment corrects and determines a measurement target region identification error caused by the influence of noise based on the structural features of the projected gray code pattern group, thereby achieving a highly accurate tertiary The original coordinates can be calculated.
[装置の構成]
図1のブロック図により本実施形態の情報処理装置1100を備える三次元計測装置1000の構成例を示す。投影装置1は、空間分割パターン光を計測対象物体に投影する。パターンは、計測対象物体の表面で反射し、撮像装置2によって撮像される。撮像装置2が撮像した画像は、情報処理装置1100に送られ、情報処理装置1100によって対象物体の三次元座標が算出される。また、情報処理装置1100は、投影装置1および撮像装置2の動作を制御する。
[Device configuration]
The block diagram of FIG. 1 shows a configuration example of a three-
情報処理装置1100は、投影制御部101、画像入力部102、ラベル付与部103、ラベル変更部104、エッジ検出部105、三次元座標算出部106、出力部107とを備える。
The information processing apparatus 1100 includes a
投影制御部101は、図2に示す明部と暗部とを含むグレイコードのパターン画像を保持しており、投影装置1を制御し、グレイコードパターンの低周波パターンから高周波パターンへ順番にパターンを投影させると同時に、画像入力部102に制御信号を出力する。ただし、投影されるパターンはグレイコードに限る必要はなく、後述するグレイコードパターン群の特徴と同様の特徴を持っている空間分割パターン群であればよい。
The
画像入力部102は、投影制御部101から入力された制御信号のタイミングに合わせて、撮像装置2を制御し、撮像させ、パターンが投影された撮像画像を受けとる(画像取得)。さらに、該撮像画像をラベル付与部103に逐次出力する。ただし、パターンの投影、撮像は順番に行う必要はなく、順番は変更してもよいし、各パターンの光の波長を分けて投影し、各波長に対応した撮像装置を用いることで、全パターンを同時に投影、撮像してもよい。
The
ラベル付与部103は、パターンが投影された撮像画像の輝度値に応じて二値(白、黒)のラベルを付与する。二値化は通常の空間符号化と同様の手法を用いればよく、例えば、撮像画像の輝度ヒストグラムをある閾値で分割した際に、クラス間分散が最大となる閾値で二値化すればよい。ラベル付与部103は、得られた二値化結果をラベル変更部104に出力する。
The
ラベル変更部104は、グレイコードパターンの特徴を利用し、ラベル付与部103から入力された二値化結果のラベル付け誤りを訂正するために、ラベルを変更する。ラベル変更部302は、得られた二値化結果をエッジ検出部105に出力する。
The
エッジ検出部105は、ラベル変更部104から入力された二値化結果からサブピクセルエッジを検出する。検出されたサブピクセル精度のエッジ位置をラベル変更部104に出力する。また、全パターンの処理が終了した際は、各パターンの二値化結果とサブピクセルエッジ情報を統合し、空間符号化を行い、投影座標と画像座標の対応関係を求める(対応関係導出)。得られた投影座標と画像座標の対応関係を三次元座標算出部106に出力する。
The
三次元座標算出部106では、エッジ検出部105から入力された投影座標(投影面上の座標、即ち、プロジェクタの画像座標)と画像座標との対応関係を用いてサブピクセルエッジに対応する三次元計測点を導出する(三次元座標導出)。投影座標と画像座標との対応関係と予め求められた投影装置1と撮像装置2の較正データから、三次元座標を算出(導出)する。
The three-dimensional coordinate
出力部107は、得られた三次元座標をモニタ、他のコンピュータやサーバ装置、補助記憶装置、各種記録媒体などに出力する。
The
これらの各機能部は、CPU2310が、ROM2320に格納されたプログラムをRAM2330に展開し、後述する各フローチャートに従った処理を実行することで実現されている。また例えば、CPU2310を用いたソフトウェア処理の代替としてハードウェアを構成する場合には、ここで説明する各機能部の処理に対応させた演算部や回路を構成すればよい。
Each of these functional units is realized by the
[計測処理]
図6のフローチャートにより第1の実施形態の情報処理装置1100による計測処理を説明する。
[Measurement processing]
The measurement process by the information processing apparatus 1100 of the first embodiment will be described with reference to the flowchart of FIG.
(ステップS11)
ステップS11では、三次元計測装置1000が起動されると、初期化処理が実行される。初期化処理には、投影装置1や撮像装置2の起動、投影装置1と撮像装置2の較正データや投影パターンを読み込む処理などが含まれる。
(Step S11)
In step S11, when the three-
(ステップS12)
ステップS12では、投影制御部101は、グレイコードパターンの低周波パターンから高周波パターンの順で投影装置1にパターンを投影させるとともに、画像入力部102に制御信号を送る。制御信号を受けた画像入力部102は、撮像装置2にパターンが投影された画像を撮像させ、撮像画像をラベル付与部103に送る。
(Step S12)
In step S <b> 12, the
(ステップS13)
ステップS13では、撮像画像を受けたラベル付与部103はパターンが投影された撮像画像に二値のラベルを付与する。
(Step S13)
In step S13, the
(ステップS14)
ステップS14では、ラベル変更部104が、グレイコードの特徴に基づき、これまでに検出されたエッジ位置を用いて、パターン群の制約が保たれるようにラベルを変更する。図2に示すように、グレイコードは隣合うコードのハミング距離が1(例えば00100と00110)であるという特徴があるため、あるパターンのエッジを形成する隣接した投影画素(以下、パターンエッジ位置)は他パターンでは同じ明暗である。また、グレイコードは識別できた領域ごとに一本のエッジを投影している。そのため、低周波パターンから高周波パターンへ順に処理をすると、エッジが検出された時点で、エッジを形成する撮像画素(以下、エッジ位置)と投影座標の対応関係が求められ、エッジ位置のそれ以降のパターンにおけるラベルを決定できる。
(Step S14)
In step S <b> 14, the
例えば、図3のパターン1に設定された枠で示すパターンエッジ位置では、パターン1で明暗が異なり、パターン2では明、パターン3以降では暗と決められている。さらに、図4の枠で示す二つのパターンエッジ位置では、パターン2で明暗が異なり、パターン3では明、パターン4以降では暗と決められている。このようにグレイコードにおけるパターンエッジ位置は、あるパターンで明暗が異なると、次のパターンでは明、それ以降のパターンでは暗、というように符号が決められている。そこで、この特徴を利用して(参照して)、より高周波なパターンを復号する際には、それまでのより低周波なパターンで検出されたエッジ位置において既に決定されているラベルでラベル変更を行う。より低周波なパターンであるほど明暗の縞が太いためコントラストが高く、ラベル付けが容易であると考えられるため、エッジ位置も確からしいと言える。したがって、低周波なパターンから順に処理をすることで、より確からしいラベルを優先的に付与することができる。エッジ位置は、後段のエッジ検出部105から得られる。このようにして、パターン群の制約(パターンの時系列の特性)が保たれた、より尤もらしい二値化結果を得る。
For example, at the pattern edge position indicated by the frame set in the
(ステップS15)
ステップS15では、エッジ検出部105が、二値化結果に基づき、エッジ位置、および、サブピクセルエッジを検出する。エッジ検出部105による処理を図5に示す。まず、二値化結果を画像の横方向(エッジが横方向であれば画像の縦方向)に走査して、白ラベルと黒ラベルが入れ替わる境界の隣接画素を抽出し、エッジ位置とする。そして、エッジ位置が滑らかに繋がるようなサブピクセルエッジを、関数フィッティングを行うなどして求める。なお、エッジ位置は隣接画素に限定する必要はなく、複数の画素によって幅を持たせてもよい。また、サブピクセルエッジの求め方も関数フィッティングに限定する必要はない。例えば、図2の正パターンに加えて明暗反転パターンも投影、撮像し、正パターンと反転パターンの観測輝度をプロットした際にできる交点位置をサブピクセルエッジとしてもよい。エッジ検出部105では、このようにして得られたパターンの二値化結果とサブピクセルエッジを記憶し、エッジ位置をラベル変更部104に出力する。
(Step S15)
In step S15, the
(ステップS16)
ステップS16では、エッジ検出部105は、全パターン画像の投影、撮像、および、処理が終了したかを判定する。終了していれば、ステップS17に処理が進み、終了していなければ、ステップS12に処理が戻る。
(Step S16)
In step S16, the
(ステップS17)
ステップS17では、三次元座標算出部106は、投影座標と画像座標との対応関係から、三次元座標を算出して、出力部107に送出する。そして、出力部107が三次元座標のデータを出力し、処理を終了する。
(Step S17)
In step S <b> 17, the three-dimensional coordinate
なお、ステップS12の処理は必ずしも繰り返しの中に含める必要はない。ステップS12で全パターンを投影、撮像してからステップS13からステップS15までの処理を繰り返してもよいし、並列処理することも可能である。また、ステップS13とステップS14の処理については、図に示す順序で実行する必要はなく、適宜順序を入れ替えてもよい。 Note that the processing in step S12 is not necessarily included in the repetition. After all patterns are projected and imaged in step S12, the processing from step S13 to step S15 may be repeated, or parallel processing may be performed. Moreover, it is not necessary to perform the process of step S13 and step S14 in the order shown to a figure, and you may replace an order suitably.
上記に述べた構成で、投影パターンの幾何的特徴を利用して、空間コードの符号の誤りを訂正することにより、撮像画像に発生したノイズの影響を低減し、三次元座標を高精度に算出することができる。 With the configuration described above, using the geometric features of the projection pattern, correcting the spatial code sign error reduces the effect of noise generated on the captured image and calculates the three-dimensional coordinates with high accuracy. can do.
(第2の実施形態)
第2の実施形態では、グレイコードよりも低反射物体の計測に適しているMaximum min Stripe−Width(以下、MMSW)パターンを投影し、空間符号化を行う。さらに、MMSWパターン群の特徴に基づき、ノイズの影響を受けて発生した計測対象領域の識別誤りを訂正、決定することで、高精度な三次元座標を算出する。
(Second Embodiment)
In the second embodiment, a maximum min stripe-width (hereinafter referred to as MMSW) pattern that is more suitable for measurement of an object that is less reflective than the gray code is projected, and spatial encoding is performed. Furthermore, high-precision three-dimensional coordinates are calculated by correcting and determining an identification error of the measurement target region that has occurred under the influence of noise based on the characteristics of the MMSW pattern group.
[装置の構成]
以下、本発明にかかる第2の実施形態の情報処理装置2100を説明する。
[Device configuration]
The information processing apparatus 2100 according to the second embodiment of the present invention will be described below.
情報処理装置2100は、投影制御部201、画像入力部202、ラベル付与部203、ラベル変更部204、エッジ検出部205、三次元座標算出部206、出力部207とを備える。本実施形態のブロック図は第1の実施形態(図1)と同様の構成であるため、ブロック図を省略する。 The information processing apparatus 2100 includes a projection control unit 201, an image input unit 202, a label assignment unit 203, a label change unit 204, an edge detection unit 205, a three-dimensional coordinate calculation unit 206, and an output unit 207. Since the block diagram of the present embodiment has the same configuration as that of the first embodiment (FIG. 1), the block diagram is omitted.
投影制御部201は、非特許文献1で用いられている図7に示すMMSWのパターン画像を保持している。MMSWパターンは最も幅が狭い縞がなるべく太くなるように設計されたパターンである。したがって、図8に示すように、MMSWは最も細い縞の幅がグレイコードに比べ太い縞で構成されたコードであるため、最も不利な時のコントラストが高くノイズの影響を受けにくい特徴を持っており、より低反射物体の計測に適している。投影装置1を制御し、MMSWパターンを投影させると同時に、画像入力部2に制御信号を出力する。ただし、投影されるパターンはMMSWに限る必要はなく、後述するラベル変更部204の説明で記述するMMSWパターン群の特徴を持っている空間分割パターン群であればよい。また、パターンの投影、撮像は順不同であり、各パターンの光の波長を分けて投影し、各波長に対応した撮像装置を用いることで、全パターンを同時に投影、撮像してもよい。
The projection control unit 201 holds the pattern image of the MMSW shown in FIG. The MMSW pattern is a pattern designed so that the narrowest stripe is as thick as possible. Therefore, as shown in FIG. 8, MMSW is a code composed of a stripe whose width of the thinnest stripe is thicker than that of a gray code, and therefore has a feature that the contrast is high at the most disadvantageous and is not easily affected by noise. Therefore, it is suitable for the measurement of lower reflection objects. The
ラベル変更部204は、MMSWパターンの特徴を利用し、ラベル付与部203から入力された二値化結果のラベル付け誤りを訂正する。MMSWはグレイコードと同様に、パターンエッジ位置のハミング距離が1であるという特徴がある。そのため、全パターンの二値化が完了した後、エッジ位置のハミング距離が1になるようにラベルを変更すれば、パターン群の制約が保たれた二値化結果が得られる。得られた二値化結果をエッジ検出部205に出力する。 The label changing unit 204 corrects the labeling error of the binarization result input from the label adding unit 203 using the feature of the MMSW pattern. The MMSW has a feature that the hamming distance of the pattern edge position is 1 like the gray code. Therefore, after the binarization of all patterns is completed, if the label is changed so that the hamming distance of the edge position becomes 1, a binarization result in which the pattern group constraint is maintained can be obtained. The obtained binarization result is output to the edge detection unit 205.
その他の動作については、第1の実施形態と同様であるため省略する。 Other operations are the same as those in the first embodiment, and thus are omitted.
[計測処理]
図14のフローチャートにより第2の実施形態の三次元計測装置2000による計測処理を説明する。
[Measurement processing]
The measurement process by the three-dimensional measurement apparatus 2000 of the second embodiment will be described with reference to the flowchart of FIG.
(ステップS22)
ステップS22では、投影制御部201は、投影装置1にMMSWパターン光を投影させるとともに、画像入力部202に制御信号を送る。制御信号を受けた画像入力部202は、撮像装置2にパターンが投影された画像を撮像させる。ステップS23の判定により、全パターン画像の投影、撮像が終了するまでステップS22が繰り返される。終了後、撮像画像を画像処理部203に送る。
(Step S22)
In step S <b> 22, the projection control unit 201 causes the
(ステップS24)
ステップS24では、撮像画像を受けたラベル付与部203は、パターンが投影された撮像画像に二値のラベルを付与する。
(Step S24)
In step S24, the label assigning unit 203 that has received the captured image provides a binary label to the captured image on which the pattern is projected.
(ステップS25)
ステップS25では、ラベル変更部204が、MMSWの特徴に基づき、パターン群の制約が保たれるようにラベルを変更する。
(Step S25)
In step S25, the label changing unit 204 changes the label based on the features of the MMSW so that the restrictions on the pattern group are maintained.
本実施形態では、MMSWパターンの特徴を利用し、ラベル付与部203から入力された二値化結果のラベル付け誤りを訂正する。MMSWはグレイコードと同様に、パターンエッジ位置のハミング距離が1であるという特徴がある。そのため、全パターンの二値化が完了した後、エッジ位置のハミング距離が1になるようにラベルを変更すれば、パターン群の制約が保たれた二値化結果が得られる。 In this embodiment, the labeling error of the binarization result input from the label assigning unit 203 is corrected using the feature of the MMSW pattern. The MMSW has a feature that the hamming distance of the pattern edge position is 1 like the gray code. Therefore, after the binarization of all patterns is completed, if the label is changed so that the hamming distance of the edge position becomes 1, a binarization result in which the pattern group constraint is maintained can be obtained.
MMSWパターンの特徴を利用したラベル付け誤りの訂正方法について詳しく述べる。ここでは図7のMMSWパターンにおいて、横方向に連続する511から515画素目を例に挙げて、処理の流れを説明する。図9に511から515画素目の連続画素におけるMMSWの投影パターンを示す。図9のように、MMSWのパターンエッジ位置のハミング距離は1であり、枠で囲っている部分のみ明暗が変化している。各投影画素に対して対応するコードが決められており、例えば、513画素目に対応するコードは0000110011というように、MMSWでは対応表を用いて投影画素とコードを対応させる。以下、あるコードに対して対応する投影画素を対応画素と呼ぶ。各パターンの撮像画像を二値化した結果を図10に示す。ただし、図10では一部に二値化の誤りを含んでいるものとする。 A method for correcting a labeling error using the features of the MMSW pattern will be described in detail. Here, in the MMSW pattern of FIG. 7, the flow of processing will be described by taking the 511th to 515th pixels that are continuous in the horizontal direction as an example. FIG. 9 shows a projection pattern of MMSW in the continuous pixels from 511 to 515 pixels. As shown in FIG. 9, the Hamming distance of the pattern edge position of the MMSW is 1, and the brightness changes only in the part surrounded by the frame. For each projection pixel, a corresponding code is determined. For example, the code corresponding to the 513th pixel is 0000110011, and the MMSW uses the correspondence table to associate the projection pixel with the code. Hereinafter, a projection pixel corresponding to a certain code is referred to as a corresponding pixel. The result of binarizing the captured image of each pattern is shown in FIG. However, in FIG. 10, it is assumed that a part of the binarization error is included.
まず、誤りの可能性がある誤り候補を検出する。MMSWは各パターンが太い縞であるため、局所的に異なるラベルが振られることはほとんど起こらないと考えられる。よって、図11の灰色画素のように、各パターンにおいて、ラベルが1画素ごとに白‐黒‐白(1‐0‐1)、または、黒‐白‐黒(0‐1‐0)と変化する中央の画素は誤りの可能性が高いため、誤り候補とする。また、図11の灰枠のように、誤り候補を含まない白ラベルと黒ラベルが変化する隣接画素を抽出し、エッジ位置とする。 First, an error candidate having a possibility of error is detected. In the MMSW, since each pattern is a thick stripe, it is considered that a different label is hardly shaken locally. Therefore, as in the gray pixel of FIG. 11, in each pattern, the label changes as white-black-white (1-0-1) or black-white-black (0-1-0) for each pixel. Since the center pixel is likely to be erroneous, it is determined as an error candidate. Further, as in the gray frame in FIG. 11, adjacent pixels in which the white label and the black label that do not include an error candidate change are extracted and set as edge positions.
続いて、図12の分類に基づいて誤り候補のラベルが誤りかどうかを判定して、必要に応じてラベルを変更する方法について説明する。 Next, a method for determining whether an error candidate label is an error based on the classification of FIG. 12 and changing the label as necessary will be described.
(ステップS1201)
はじめに、図11の領域6001のように孤立している誤り候補の画素は、誤りであると見なし、白ラベルであれば黒ラベルに、黒ラベルであれば白ラベルに変更する。
(Step S1201)
First, an error candidate pixel that is isolated as in the
(ステップS1202)
次に、領域6002、6003のように誤り候補が連続している画素の処理について述べる。ステップS1202では、領域6002のように片方の画素がエッジ位置であるか否かを判定する。片方の画素がエッジ位置である場合は、その画素ともう一方のエッジ位置の画素のハミング距離が1になるように、エッジ位置の画素つまり領域6002の右画素の白ラベルを黒ラベルに変更する。なぜなら、この二つの画素における計測対象物体表面が、ハミング距離が2となるような不連続な面であると考えるよりも、連続的な面にパターンエッジ位置に対応する部分が投影されており、領域6002の右の画素が誤っているためにハミング距離が2になっていると考えた方が尤もらしいからである。
(Step S1202)
Next, processing of pixels in which error candidates are continuous as in
(ステップS1203)
次に、ステップS1203では、ステップS1202で片方の画素がエッジ位置ではないと判定された画素に対して、両方の画素がエッジ位置であるか否かを判定する。そして、領域6003のように、連続している誤り候補の両方の画素がエッジ位置である場合、ハミング距離が1になるように、かつ、対応画素の差が小さくなるように、ラベルを変更する。なぜなら、連続する複数の撮像画素において対応画素が頻繁に変化することは、計測対象物体表面が鋭利な凹凸形状でない限り起こらないと考えられるためである。図11の例では、領域6003の右画素の対応画素は68、左画素の対応画素は512である。右画素の黒ラベルを白ラベルに変更すると、ハミング距離は1、対応画素は513となり、対応画素の差は1となる。一方、左画素の白ラベルを黒ラベルに変更すると、ハミング距離は1だが、対応画素は511となり、対応画素の差は443となってしまう。よって、右画素のラベルを変更した方が隣合う撮像画素間の対応画素の差が小さくなるため、右画素を誤りと見なしてラベルを変更すればよい。また、連続している誤り候補の画素が、エッジ位置では無い場合は、どちらが誤りか判断できないため、両方の画素のラベルを変更してもよいし、どちらか一方の画素のラベルを変更してもよい。
(Step S1203)
Next, in step S1203, it is determined whether or not both pixels are edge positions with respect to the pixel in which one pixel is determined not to be an edge position in step S1202. Then, as in the
このようにMMSWパターン群の特徴を利用することで、パターン群の制約が保たれた、図13のような、より尤もらしい二値化結果を得る。なお、誤り候補の検出は1画素ごとに限定する必要はなく、2画素以上ごとに検出してもよい。また、エッジ位置は隣接画素に限定する必要はなく、ある程度の画素幅を持たせてもよい。得られた二値化結果をエッジ検出部205に出力する。 By using the features of the MMSW pattern group in this way, a more likely binarization result as shown in FIG. 13 with the pattern group constraints maintained is obtained. Error candidate detection need not be limited to each pixel, and may be detected every two or more pixels. Further, the edge position need not be limited to adjacent pixels, and may have a certain pixel width. The obtained binarization result is output to the edge detection unit 205.
(ステップS26)
ステップS26では、そして、エッジ検出部205が、二値化結果に基づき、サブピクセルエッジを検出し、空間符号化により投影座標と画像座標の対応関係を求める。
(Step S26)
In step S26, the edge detection unit 205 detects a subpixel edge based on the binarization result, and obtains a correspondence relationship between the projection coordinate and the image coordinate by spatial encoding.
(ステップS27)
ステップS27では、三次元座標算出部206は、投影座標と画像座標との対応関係から、三次元座標を算出して、出力部207に送出する。そして、出力部207が三次元座標のデータを出力し、処理を終了する。
(Step S27)
In step S <b> 27, the three-dimensional coordinate calculation unit 206 calculates the three-dimensional coordinates from the correspondence between the projected coordinates and the image coordinates, and sends them to the output unit 207. Then, the output unit 207 outputs the three-dimensional coordinate data, and the process ends.
このように、空間分割パターン群として太い縞で構成されているMMSWを用いて、MMSWパターン群の特徴を利用することで、撮像画像に発生したノイズの影響を低減し、三次元座標を高精度に算出することができる。 In this way, using the MMSW configured with thick stripes as the space division pattern group and using the features of the MMSW pattern group, the effect of noise generated on the captured image is reduced, and the three-dimensional coordinates are highly accurate. Can be calculated.
(第3の実施形態)
第3の実施形態において説明する装置は、パターン投影を用いた三次元計測装置であり、MMSWパターンなどを用いて、投影の有無を表す二値化のラベル付けを行う際に、曖昧な領域には曖昧なことを示すラベルを一旦付与し、後段の処理で空間的な近傍情報(分布)に基づいて、二値化のラベル付けを確定する。このようにすることにより、ノイズの影響を受けて計測対象領域の識別誤りが発生することを防止することが可能となり、高精度な三次元座標を算出することができる。
(Third embodiment)
The apparatus described in the third embodiment is a three-dimensional measurement apparatus using pattern projection. When performing binarization labeling indicating the presence / absence of projection using an MMSW pattern or the like, an ambiguous area is used. Temporarily assigns a label indicating that it is ambiguous, and finalizes binarization labeling based on spatial neighborhood information (distribution) in the subsequent processing. By doing in this way, it becomes possible to prevent the identification error of the measurement target area from being affected by noise, and it is possible to calculate highly accurate three-dimensional coordinates.
[装置の構成]
第3の実施形態に係る情報処理装置3100は、投影制御部301、画像入力部302、ラベル付与部303、ラベル変更部304、エッジ検出部305、第2のラベル変更部306、三次元座標算出部307、出力部308とを備える。以下、本発明にかかる第3の実施形態の情報処理装置3100を図15のブロック図により説明する。第3の実施形態は、図1の構成を一部変更したものである。ここでは第1の実施形態と異なる部分を中心に説明する。
[Device configuration]
An
投影制御部301は、第2の実施形態と同様にMMSWのパターン画像を保持しており、同様の処理を行うため説明を省略する。投影パターンはMMSWに限る必要はないが、高いコントラストが得られるパターンが望ましい。
The
ラベル付与部303では、パターンが投影された撮像画像の輝度値に応じて三値(白、灰、黒)のラベルを付与する。得られた三値化結果をラベル変更部304に出力する。
The
ラベル変更部304は、撮像画像において空間的な近傍では同ラベルである可能性が高いという情報を利用して、ラベル付与部303から入力された三値化結果を初期値として最適化し、ラベルを決定する。得られた三値最適化結果をエッジ検出部305に出力する。
The
エッジ検出部305は、ラベル変更部304から入力された三値最適化結果からサブピクセルエッジ(境界位置)を検出する。処理の詳細は後述する。求められたサブピクセルエッジを第2のラベル変更部306に出力する。
The
第2のラベル変更部306は、エッジ検出部305から入力されたサブピクセルエッジに従って、曖昧領域(灰ラベル)の白ラベル、黒ラベルを決定し、空間符号化する。処理の詳細は後述する。
The second
その他の構成については、第1の実施形態と同様であるため省略する。 Other configurations are the same as those in the first embodiment, and are omitted.
[計測処理]
図18のフローチャートにより第3の実施形態の三次元計測装置3000による計測処理を説明する。
[Measurement processing]
A measurement process performed by the three-
(ステップS31)
ステップS31では、三次元計測装置3000が起動されると、初期化処理が実行される。初期化処理には、投影装置1や撮像装置2の起動、投影装置1と撮像装置2の較正データや投影パターンを読み込む処理などが含まれる。
(Step S31)
In step S31, when the three-
(ステップS32)
ステップS32では、投影制御部301は、MMSWパターンを投影装置1に投影させるとともに、画像入力部302に制御信号を送る。制御信号を受けた画像入力部302は、撮像装置2にパターンが投影された画像を撮像させ、撮像画像をラベル付与部303に送る。
(Step S32)
In step S <b> 32, the
(ステップS33)
ステップS33では、撮像画像を受けたラベル付与部303は、パターンが投影された撮像画像に三値のラベルを付与する。ラベル付与部303は、パターンが投影された撮像画像の輝度値に応じて三値(白、灰、黒)のラベルを付与する。グレイコードのような明暗パターンを用いた空間符号化では、通常撮像画像を二値(白、黒)にラベル付けし識別するが、ここでは曖昧で決められない部分は無理に二値化せず、灰ラベルを付与しておき、後段で二値化する。ある画素pにおける三値化結果gpは、撮像画像の輝度I、白ラベルと黒ラベルを分ける輝度の閾値t、灰ラベルの輝度範囲wを用いると、
(Step S33)
In step S <b> 33, the
と表わされる。1が白ラベル、0が灰ラベル、−1が黒ラベルを表している。閾値tは、第1の実施形態と同様に、通常の空間符号化において二値化の際に用いる閾値と同じ値を設定すればよい。灰ラベルの輝度範囲wは、後述する注目画素pの信頼度に基づき、値を決定する。三値化を行うことによって、閾値付近の曖昧な部分を無理に二値化せず後段の第2のラベル変更部306で精度良くラベルを決めることができる。さらに、MMSWパターンを用いているおかげでコントラストが比較的高く、信頼度が高くなるため、灰ラベルになる割合を低く抑えられる。このようにして得られた三値化結果をラベル変更部304に出力する。
It is expressed as 1 represents a white label, 0 represents a gray label, and -1 represents a black label. As in the first embodiment, the threshold value t may be set to the same value as the threshold value used for binarization in normal spatial coding. The gray label luminance range w is determined based on the reliability of the pixel of interest p described later. By performing the ternarization, it is possible to accurately determine the label by the second
信頼度と灰ラベルの輝度範囲wについて説明する。信頼度とは、注目画素pにおけるラベル誤り率、SN比、輝度の大きさなどに基づいて決めることができる値である。例えば、計測対象に対して明部だけからなるパターンと暗部だけからなるパターンをそれぞれ投影して撮像した2枚の画像において、暗部だけからなるパターンを投影した画像の方が輝度が高くなっている画素は、投影パターンのSN比が低く誤りが生じていると考えられる。そこで、注目画素pに対して適当な大きさの窓を考え、近傍領域の画素の中で誤りが発生している画素の割合をラベル誤り率とし、1とラベル誤り率の差を信頼度とする。信頼度が低いほど白ラベルにすべきか黒ラベルにすべきか決めづらいため、灰ラベルにラベル付けされる画素が非常に多くなってしまう傾向にある.そのため,灰ラベルの輝度範囲wは注目画素pの信頼度が高いほどwの値を大きく、信頼度が低いほどwの値を小さく設定する。このように閾値を設定することで、灰ラベルにラベル付けされる画素数をある程度の範囲に収めることができる。 The reliability and the luminance range w of the gray label will be described. The reliability is a value that can be determined based on a label error rate, an SN ratio, a luminance level, and the like at the target pixel p. For example, in two images obtained by projecting and imaging a pattern consisting only of a bright part and a pattern consisting only of a dark part on the measurement target, the brightness of the image projected from the pattern consisting only of the dark part is higher It is considered that the pixel has a low SN ratio of the projection pattern and an error has occurred. Therefore, a window having an appropriate size with respect to the pixel of interest p is considered, the ratio of pixels in which errors occur in the pixels in the vicinity region is defined as a label error rate, and the difference between 1 and the label error rate is defined as the reliability. To do. The lower the reliability, the harder it is to decide whether the label should be a white label or a black label, so the number of pixels labeled on the gray label tends to be very large. Therefore, the brightness range w of the gray label is set such that the value of w increases as the reliability of the pixel of interest p increases, and the value of w decreases as the reliability decreases. By setting the threshold value in this way, the number of pixels labeled on the gray label can be kept within a certain range.
(ステップS304)
次に、三値のラベルを受けたラベル変更部304は、各画素のラベルを空間的な近傍情報に基づき、尤もらしいラベルに最適化し、決定(変更)する。即ち、ラベル変更部304は、撮像画像において空間的な近傍では同ラベルである可能性が高いという情報を利用して、ラベル付与部303から入力された三値化結果を初期値として最適化し、ラベルを変更する。縞パターンはある程度の縞の幅を持ったパターンであること、および、一般的には投影装置1よりも撮像装置2の方が空間解像度が高いことから、投影パターンにおける明暗の縞幅は複数の撮像画素と対応する。したがって、撮像画像中の注目画素の近傍画素(8近傍など)を見た際、近傍画素は注目画素と同ラベルである可能性が高い。これを利用し、例えば、近傍画素において各ラベルの多数決を取ることで注目画素のラベルを決定すれば、注目画素により尤もらしいラベルを付与することができる。ここでは、下記のようなコスト関数Cを設計し、コストが最小になるようなラベル組み合わせGを求める。
(Step S304)
Next, the
Vはすべての画素の集合、Eはすべての画素に対応する近傍画素の集合を表す。また、pは注目画素、qは近傍画素を示す添え字である。データコストDは注目画素p単体としてみた場合にどのラベルが妥当かを表し、スムーズコストWは近傍画素qのラベルと注目画素pの関係を見た場合にどのラベルが妥当かを表している。λは重みを表すが、λが大きいほどスムーズコストWの影響が大きくなり、強く平滑化されたような結果となる。データコストDやスムーズコストWの設計は、上記ではラベル情報のみを用いているが、撮像画像の輝度情報を用いるなどしてもよい。コスト関数Cを最小化する手法としては、Iterated Conditional Modes、Graph Cut、Belief Propagationなど様々あるが、どれを用いてもよい。このようにして、ノイズの影響が大きいために発生したラベル付け誤りを低減する。得られた三値最適化結果をエッジ検出部305に出力する。
V represents a set of all pixels, and E represents a set of neighboring pixels corresponding to all pixels. Further, p is a target pixel, and q is a subscript indicating a neighboring pixel. The data cost D indicates which label is appropriate when viewed as the pixel of interest p alone, and the smooth cost W indicates which label is appropriate when the relationship between the label of the neighboring pixel q and the pixel of interest p is viewed. λ represents a weight, but the larger the λ, the greater the effect of the smooth cost W, resulting in a stronger smoothed result. In the design of the data cost D and the smooth cost W, only the label information is used in the above, but the luminance information of the captured image may be used. There are various methods for minimizing the cost function C, such as Iterated Conditional Mode, Graph Cut, Belief Propagation, and any of them may be used. In this way, labeling errors that occur due to the effect of noise are reduced. The obtained ternary optimization result is output to the
(ステップS35)
ステップS35において、エッジ検出部305は、決定した三値最適化結果に基づき、サブピクセルエッジを検出する。
(Step S35)
In step S <b> 35, the
エッジ検出部305による処理を図16に示す。灰ラベル付近にエッジが存在すると考えられるため、まず、三値化結果を画像の横方向(エッジが横方向であれば画像の縦方向)に走査して、灰ラベルとその近傍の白黒ラベルの領域を抽出し、エッジの候補点とする。そして、エッジ候補点群の中心付近を通るようなサブピクセルエッジを、エッジ候補点に対して関数フィッティングを行うなどして求める。求められたサブピクセルエッジを第2のラベル変更部403に出力する。
The processing by the
(ステップS36)
ステップS36において、第2のラベル変更部306は、求められたサブピクセルエッジに基づき、エッジ位置を検出し、灰ラベルを二値の白黒ラベルに変更する。
(Step S36)
In step S36, the second
第2のラベル変更部306の処理を図17に示す。まず、サブピクセルエッジが通る画素単位の位置であるエッジ位置(境界位置)を求める。エッジ位置以外の灰ラベルは、エッジ位置の左右(エッジが横方向であれば上下)でラベルを決定する。例えば図17の場合では、エッジ位置の左にある場合は黒ラベル、右にある場合は白ラベルに変更する。次に、エッジ位置の灰ラベルを、サブピクセルエッジを境界として左右で画素内の面積が広い方のラベルに変更する。図17下の場合のように、エッジ位置のある画素においてサブピクセルエッジが左寄りである場合は、右側の面積が広いので白ラベルに変更する。このようにして、エッジ位置と二値化結果を得る。なお、エッジ位置はサブピクセルエッジが通る画素に限定する必要はなく、ある程度の画素幅を持たせてもよい。
The processing of the second
(ステップS37)
ステップS37において、全パターン画像の投影、撮像、および、処理が終了したかを判定する。処理が終了したと判定されるまで、ステップS32からステップS36までが繰り返され、空間符号化により投影座標と画像座標の対応関係を求められる。処理すべきパターンがまだ残っている場合は、得られたパターンの三値化結果とサブピクセルエッジを記憶し、次のパターンの処理を行う。全パターンの処理が終了した際は、各パターンの多値化結果とサブピクセルエッジ情報を統合し、空間符号化を行い、投影座標と画像座標の対応関係を求める。得られた投影座標と画像座標の対応関係を三次元座標算出部307に出力する。
(Step S37)
In step S37, it is determined whether the projection, imaging, and processing of all pattern images have been completed. Steps S32 to S36 are repeated until it is determined that the processing is completed, and the correspondence between the projection coordinates and the image coordinates is obtained by spatial encoding. When the pattern to be processed still remains, the ternarization result of the obtained pattern and the subpixel edge are stored, and the next pattern is processed. When all the patterns have been processed, the multi-value quantization results and subpixel edge information of each pattern are integrated, spatial coding is performed, and the correspondence between the projected coordinates and the image coordinates is obtained. The obtained correspondence between the projected coordinates and the image coordinates is output to the three-dimensional coordinate
(ステップS38)
ステップS38において、三次元座標算出部307は、投影座標と画像座標との対応関係から、三次元座標を算出して、出力部308に送出する。そして、出力部308が三次元座標のデータを出力し、処理を終了する。
(Step S38)
In step S <b> 38, the three-dimensional coordinate
なお、ステップS32の処理は図の繰り返しの中に含める必要はない。ステップS32で全パターンを投影、撮像してからステップS33からステップS36までの処理を繰り返してもよいし、並列処理することも可能である。 Note that the process of step S32 need not be included in the repetition of the figure. After all patterns are projected and imaged in step S32, the processing from step S33 to step S36 may be repeated, or parallel processing may be performed.
このように、縞幅の細いパターンを含まないパターン群を用いて、空間的な近傍情報を利用することで、撮像画像に発生したノイズの影響を低減し、三次元座標を高精度に算出することができる。 In this way, by using spatial neighborhood information using a pattern group that does not include a pattern with a narrow stripe width, the influence of noise generated in the captured image is reduced, and three-dimensional coordinates are calculated with high accuracy. be able to.
(第4の実施形態)
第4の実施形態において説明する装置は、三次元計測装置であり、投影されるパターンの輝度レベルが多段階であり、投影の有無を表すラベル付けを行う際に、投影輝度レベルよりも多段階のラベルを用いて曖昧な領域には曖昧なことを示すラベルを付与する。曖昧なラベルは空間的な近傍情報に基づき後段の処理で投影輝度レベルに合わせたラベルに修正することによって、ノイズの影響を受けて発生する計測対象領域の識別誤りを訂正し、より少ない投影枚数によって、高精度な三次元座標を算出する。
(Fourth embodiment)
The apparatus described in the fourth embodiment is a three-dimensional measuring apparatus, and the projected pattern has multiple levels of brightness levels. When performing labeling indicating the presence or absence of projection, the levels are higher than the projected brightness level. A label indicating that the area is ambiguous is assigned to the ambiguous area. The ambiguous label is corrected to a label that matches the projection brightness level in the subsequent processing based on spatial proximity information, thereby correcting the identification error of the measurement target area caused by noise and reducing the number of projected images. To calculate highly accurate three-dimensional coordinates.
[装置の構成]
以下、本実施形態における装置の構成について説明する。第4の実施形態に係る情報処理装置4100は、投影制御部401、画像入力部402、ラベル付与部403、ラベル変更部404、エッジ検出部405、第2のラベル変更部406、三次元座標算出部407、出力部408とを備える。第4の実施形態は、図15の構成を一部変更したものである。従って、ここでは第3の実施形態と異なる部分を中心に説明する。
[Device configuration]
Hereinafter, the configuration of the apparatus according to the present embodiment will be described. An information processing apparatus 4100 according to the fourth embodiment includes a projection control unit 401, an image input unit 402, a label applying unit 403, a label changing unit 404, an edge detecting unit 405, a second label changing unit 406, and three-dimensional coordinate calculation. Unit 407 and output unit 408. In the fourth embodiment, the configuration of FIG. 15 is partially changed. Therefore, here, the description will focus on the parts different from the third embodiment.
投影制御部401は、図19に示すP1、P2…Pmのm段階(P1>P2>…>Pmとしても一般性を失わない)の輝度レベル(図19ではm=4)からなるパターン画像を保持しており、投影制御部1を制御し、1枚ずつ順番にパターンを投影させると同時に、画像入力部402に制御信号を出力する。ただし、パターンの投影、撮像は順不同であり、各パターンの光の波長を分けて投影し、各波長に対応した撮像装置を用いることで、全パターンを同時に投影、撮像してもよい。図19に示したパターンの例では、(1)から(4)は対象物体に各輝度レベルを投影した時の観測輝度を求めるための輝度較正用パターンであり、(5)から(7)は空間分割のための符号化パターンである。多値のパターンを用いることで、1枚当たりの識別可能な領域が増えるため、より少ない投影枚数で投影装置1と撮像装置2との対応関係を求めることができる。例えば、グレイコードのような通常の明暗パターンでは、新たな符号化パターンを1枚投影するごとに一意に識別可能な領域の数が2倍に増えるが、図19に示した例では、4段階の輝度レベルから成るパターンであるため、新たな符号化パターン1枚に付き一意に識別可能な領域の数が4倍に増える。
The projection control unit 401 generates a pattern image having luminance levels (m = 4 in FIG. 19) in m stages (P1> P2>...> Pm) of P1, P2,. The
ラベル変更部404は、空間的な近傍では同ラベルである可能性が高いことを利用しラベルを変更する。 The label changing unit 404 changes the label using the fact that there is a high possibility that the label is in the spatial vicinity.
エッジ検出部405は、多値化結果からサブピクセルエッジを求める。 The edge detection unit 405 obtains a subpixel edge from the multivalued result.
第2のラベル変更部406は、サブピクセルエッジを元に多値化結果を投影輝度レベルに決定する。 The second label changing unit 406 determines the multi-value quantization result as the projection luminance level based on the subpixel edge.
ラベル付与部403は、パターンが投影された撮像画像のm段階の輝度値に対応するラベルをL1、L2…Lm、およびそれらに属さない未決定のラベルUを付与する。 The label assigning unit 403 assigns L1, L2,... Lm labels corresponding to m-level luminance values of the captured image on which the pattern is projected, and undecided labels U that do not belong to them.
ラベル変更部404は、第3の実施形態と同様に、ラベル付与部403から入力された多値化結果を初期値として最適化し、ラベルを決定する。得られた多値最適化結果をエッジ検出手段405に出力する。 As in the third embodiment, the label changing unit 404 optimizes the multi-value quantization result input from the label assigning unit 403 as an initial value, and determines a label. The obtained multi-value optimization result is output to the edge detection means 405.
エッジ検出部323では、第3の実施形態と同様に、ラベル変更部404から入力された多値最適化結果からサブピクセルエッジを検出する。求められたサブピクセルエッジを第2のラベル変更部406に出力する。 The edge detection unit 323 detects the subpixel edge from the multi-value optimization result input from the label change unit 404, as in the third embodiment. The obtained subpixel edge is output to the second label changing unit 406.
第2のラベル変更部406は、エッジ検出部405から入力されたサブピクセルエッジに従って、未決定ラベルUを投影パターンの輝度レベルに対応したラベルLiに変更し、空間符号化する。第2のラベル変更部406の処理は第3の実施形態で述べた灰ラベルを未決定ラベルUに、白ラベルと黒ラベルを後述する集合Φに含まれるラベルペアに置き変えて考えれば、同様の処理となるため説明を省略する。このようにして、エッジ位置と多値化結果を得る。 The second label changing unit 406 changes the undecided label U to the label Li corresponding to the luminance level of the projection pattern in accordance with the subpixel edge input from the edge detecting unit 405, and performs spatial encoding. The processing of the second label changing unit 406 is similar if the gray label described in the third embodiment is replaced with the undetermined label U, and the white label and the black label are replaced with a label pair included in the set Φ described later. Since this is a process, the description is omitted. In this way, the edge position and the multivalued result are obtained.
その他の構成については、第3の実施形態と同様であるため省略する。 Other configurations are the same as those in the third embodiment, and are therefore omitted.
[計測処理]
図20のフローチャートにより第4の実施形態の三次元計測装置4000による計測処理を説明する。ただし、そのうちの多くは第3の実施形態と同様であるため説明を省略し、違いのあるステップのみ説明する。
[Measurement processing]
Measurement processing by the three-dimensional measurement apparatus 4000 of the fourth embodiment will be described with reference to the flowchart of FIG. However, since many of them are the same as those in the third embodiment, the description thereof will be omitted, and only steps that are different will be described.
(ステップS42)
ステップS42において、投影制御部401は、図19に示したような多値パターンを投影装置1に投影させるとともに、画像入力部402に制御信号を送る。制御信号を受けた画像入力部402は、撮像装置2にパターンが投影された画像を撮像させ、撮像画像をラベル付与部403に送る。
(Step S42)
In step S <b> 42, the projection control unit 401 causes the
(ステップS43)
ステップS43において、撮像画像を受けたラベル付与部403は、パターンが投影された撮像画像に多値のラベルを付与する。ラベル付与部403は、パターンが投影された撮像画像のm段階の輝度値に対応するラベルをL1、L2…Lm、およびそれらに属さない未決定のラベルUを付与する。このようなラベルUを導入することで、この段階では曖昧で決められない部分は無理に決めず、後段で空間情報を用いてより正確にラベルを決めることができる。そのため、ラベル付けが難しいエッジ付近のラベル付け誤りを低減することができる。
(Step S43)
In step S43, the label attaching unit 403 that has received the captured image provides a multi-value label to the captured image on which the pattern is projected. The label assigning unit 403 assigns L1, L2,... Lm labels corresponding to m-level luminance values of the captured image on which the pattern is projected, and undecided labels U that do not belong to them. By introducing such a label U, it is possible to determine the label more accurately by using spatial information at a later stage without forcibly determining the ambiguous and undecidable part at this stage. Therefore, it is possible to reduce labeling errors in the vicinity of edges that are difficult to label.
上記に示した多値ラベルの付け方について説明する。まず、図19に示した投影パターンのうち投影画素全てを輝度レベルPi(i=1,2,…,m)としたパターンである(1)〜(4)に示した輝度較正用パターンを、対象物体に投影して撮像した画像において、ある画素pで観測される輝度値をIp(Pi)とする。そして、図19に示した(5)〜(7)の符号化パターンを順次投影し、撮像していく。各符号化パターンを投影した画像に対して、画素pにおける多値化結果gpは、撮像画像の輝度Ip、各輝度レベルにおいてその輝度ラベルであると見なす輝度範囲をwp(Pi)とすると、 A method of attaching the multi-value label shown above will be described. First, the brightness calibration patterns shown in (1) to (4), which are the patterns in which all the projection pixels in the projection pattern shown in FIG. 19 have the brightness level Pi (i = 1, 2,..., M), In an image captured by being projected onto a target object, the luminance value observed at a certain pixel p is defined as I p (Pi). Then, the encoding patterns (5) to (7) shown in FIG. 19 are sequentially projected and imaged. For an image in which each coding pattern is projected, the multi-value quantization result g p at the pixel p is the luminance I p of the captured image, and the luminance range regarded as the luminance label at each luminance level is w p (Pi). Then
と表わされる。輝度範囲wp(Pi)はカメラの輝度値Ip(Pi)における標準偏差に基づいて決定すればよい。ただし、これに限るものではなく、wp(Pi)の値は例えばIp(Pi)の0.1倍等の比で与えたり、適当な固定値を用いてもよい。得られた多値化結果をラベル変更部404に出力する。なお、未決定のラベルUは1つのラベルに限る必要はなく、どの輝度値の間かによって多値のラベルを付与してもよい。 It is expressed as The luminance range w p (Pi) may be determined based on the standard deviation in the luminance value I p (Pi) of the camera. However, the present invention is not limited to this, and the value of w p (Pi) may be given by a ratio such as 0.1 times I p (Pi), or an appropriate fixed value may be used. The obtained multi-value quantization result is output to the label changing unit 404. Note that the undetermined label U is not necessarily limited to one label, and a multi-value label may be given depending on which luminance value is present.
(ステップS44)
ここでは、下記のようなコスト関数Cを設計し、コストが最小になるようなラベル組み合わせGを求める(コストを評価する)。
(Step S44)
Here, a cost function C as described below is designed to obtain a label combination G that minimizes the cost (evaluates the cost).
各記号の説明は第3の実施形態と同様であるものについては省略し、新たに定義した集合Φと関数fおよびhについてのみ説明する。集合Φは投影パターンにおいて隣合って位置する輝度レベルに対応するラベルのペア(Li,Lj)(画素同士の組)を要素とする集合であり、投影パターン毎に定義される。例えば図19の(5)ではΦ={(L1,L2),(L2,L3),(L3,L4)}であり、(6)ではΦ={(L1,L2),(L2,L3),(L3,L4),(L4,L1)}である。データコスト計算に用いる関数fは輝度値に対応するラベルの関数であり、その輝度値の大きさの順序を表す添え字を返し、データコストDが輝度レベルが大きく異なるラベルに変化するほど高いコストを与える。スムーズコスト計算に用いる関数hは、比較する二つのラベルが同じならコスト0、ラベルが異なり一方が未決定ラベルUであればコスト1、ラベルが異なりどちらも未決定ラベルではなく、投影パターンとして隣合って配置される可能性があるラベルペアである場合はコスト2、ラベルが異なりどちらも未決定ラベルではなく、投影されるパターンとして隣合うはずがないラベルペアである場合はコスト3として計算する。ただし、DやWのコストの決め方はこれに限るものではなく、コストの値や条件は投影パターンの性質によっても変化する。得られた多値最適化結果をエッジ検出部405に出力する。
The description of each symbol is omitted for those that are the same as in the third embodiment, and only the newly defined set Φ and functions f and h will be described. The set Φ is a set having a pair of labels (Li, Lj) (a set of pixels) corresponding to luminance levels positioned adjacent to each other in the projection pattern as elements, and is defined for each projection pattern. For example, in (5) of FIG. 19, Φ = {(L1, L2), (L2, L3), (L3, L4)}, and in (6), Φ = {(L1, L2), (L2, L3). , (L3, L4), (L4, L1)}. The function f used in the data cost calculation is a function of a label corresponding to the luminance value, returns a subscript indicating the order of the luminance value, and the cost increases as the data cost D changes to a label with a significantly different luminance level. give. The function h used for the smooth cost calculation is the
(ステップS45)
ステップS45では、エッジ検出部405は、第3の実施形態と同様に、ラベル変更部404から入力された多値最適化結果からサブピクセルエッジを検出する。第3の実施形態では灰ラベルとその近傍の白黒ラベルをエッジの候補点としていたが、第4の実施形態では、ラベルUとその近傍のラベルが集合Φに含まれるラベルペアである場合に、それらをエッジ候補点とする。そして、エッジ候補点群の中心付近を通るようなサブピクセルエッジを、エッジ候補点に対して関数フィッティングを行うなどして求める。
(Step S45)
In step S45, the edge detection unit 405 detects a subpixel edge from the multilevel optimization result input from the label change unit 404, as in the third embodiment. In the third embodiment, the gray label and the neighboring black and white label are used as the edge candidate points. In the fourth embodiment, when the label U and the neighboring label are a label pair included in the set Φ, Is an edge candidate point. Then, a subpixel edge that passes near the center of the edge candidate point group is obtained by performing function fitting on the edge candidate point.
(ステップS46)
ステップS46において、第2のラベル変更部406は、求められたサブピクセルエッジに基づき、エッジ位置を検出し、未決定ラベルを投影パターンの輝度レベルに対応したラベルに変更する。第2のラベル変更部406は、エッジ検出部405から入力されたサブピクセルエッジに従って、未決定ラベルUを投影パターンの輝度レベルに対応したラベルLiに変更し、空間符号化する。第2のラベル変更部406の処理は第3の実施形態で述べた灰ラベルを未決定ラベルUに、白ラベルと黒ラベルを集合Φに含まれるラベルペアに置き変えて考えれば、同様の処理となるため説明を省略する。
(Step S46)
In step S46, the second label changing unit 406 detects the edge position based on the obtained subpixel edge, and changes the undetermined label to a label corresponding to the luminance level of the projection pattern. The second label changing unit 406 changes the undecided label U to the label Li corresponding to the luminance level of the projection pattern in accordance with the subpixel edge input from the edge detecting unit 405, and performs spatial encoding. The process of the second label changing unit 406 is similar to the process described in the third embodiment by replacing the gray label with the undetermined label U and replacing the white label and the black label with the label pair included in the set Φ. Therefore, the description is omitted.
このように、多段階の輝度レベルからなる多値パターンを投影して、未決定ラベルを含むラベル付けを行ってから空間的な近傍情報を利用することで、撮像画像に発生したノイズの影響を低減し、より少ない投影枚数で三次元座標を高精度に算出することができる。 In this way, by projecting a multi-value pattern consisting of multi-level luminance levels, labeling with undetermined labels, and using spatial neighborhood information, the effect of noise generated on the captured image can be reduced. The three-dimensional coordinates can be calculated with high accuracy with a reduced number of projections.
(第5の実施形態)
第1の実施形態、第2の実施形態では空間分割パターン群の特徴を利用することで、高精度な三次元座標を算出する手法を説明した。そして、第3の実施形態、第4の実施形態では曖昧なことを示すラベルを付与し、空間的な近傍情報を利用することで、高精度な三次元座標を算出する手法を説明した。そこで、第5の実施形態では、これら二つの手法を統合し、ノイズの影響を受けて発生した計測対象領域の識別誤りを訂正、決定することで、さらに高精度な三次元座標を算出する。
(Fifth embodiment)
In the first embodiment and the second embodiment, the method of calculating highly accurate three-dimensional coordinates by using the features of the space division pattern group has been described. In the third and fourth embodiments, a method of calculating highly accurate three-dimensional coordinates by giving a label indicating that it is ambiguous and using spatial neighboring information has been described. Therefore, in the fifth embodiment, these two methods are integrated, and the three-dimensional coordinates with higher accuracy are calculated by correcting and determining the identification error of the measurement target region that has occurred under the influence of noise.
[装置の構成]
第5の実施形態に係る情報処理装置5100は、投影制御部501、画像入力部502、ラベル付与部503、ラベル変更部504、エッジ検出部505、第2のラベル変更部506、三次元座標算出部507、出力部508とを備える。
[Device configuration]
An
以下、本発明にかかる第5の実施形態の情報処理を図21のブロック図により説明する。ここでは、第1の実施形態と第3の実施形態を統合した手法として、グレイコードパターン群の特徴と空間的な近傍情報を利用した手法を説明する。 The information processing according to the fifth embodiment of the present invention will be described below with reference to the block diagram of FIG. Here, as a method in which the first embodiment and the third embodiment are integrated, a method using the features of the gray code pattern group and spatial proximity information will be described.
ラベル付与部503は、撮像画像の輝度の値に応じて三値のラベルを付与する。
The
ラベル変更部504は、第1、第2の実施形態と同様にパターンの特性を利用しラベルを変更した後、第3、第4の実施形態と同様に空間的な近傍では同ラベルである可能性が高いことを利用しラベルを変更する。詳細な処理は後述する。
The
エッジ検出部505は、三値化結果からサブピクセルエッジを求める。
The
第2のラベル変更部506は、第3の実施形態と同様に近傍の画素のラベルを見てラベルを変更してもよいが、グレイコードパターンはより低周波なパターンのラベルによって、サブピクセルエッジの左右(エッジが横方向であれば上下)のラベルが決まるため、この特性に従ってラベルを変更してもよい。例えば、図2に示すようにグレイコードのパターン1で明、パターン2で暗の領域内におけるパターン3のサブピクセルエッジでは左が明、右が暗と決まっており、一方、パターン1で明、パターン2で明の領域内におけるパターン3のサブピクセルエッジは左が暗、右が明というように決まっている。処理すべきパターンがまだ残っている場合、得られたパターンの二値化結果とサブピクセルエッジを記憶するとともに、エッジ位置をラベル変更部504に出力する。
The second
このように、三値化された曖昧なラベルを、グレイコードの低周波なパターンから順に処理し、より確からしいラベルを付与した上で、ラベルを最適化することによって、第1の実施形態や第3の実施形態よりもより誤りの少ないラベルを得ることができる。 In this way, the ternary ambiguous label is processed in order from the low-frequency pattern of the Gray code, and a more probable label is given, and then the label is optimized, so that the first embodiment or A label with fewer errors than in the third embodiment can be obtained.
[計測処理]
図22のフローチャートにより第5の実施形態の三次元計測装置5000による計測処理を説明する。
[Measurement processing]
The measurement process by the three-
ステップS53、ステップS55、ステップS56、および、ステップS57は第3の実施形態と略同様であり、その他のステップは第1の実施形態と略同様である。 Step S53, step S55, step S56, and step S57 are substantially the same as those in the third embodiment, and other steps are substantially the same as those in the first embodiment.
なお、ステップS52の処理は図の繰り返しの中に含める必要はない。ステップS52で全パターンを投影、撮像してからステップS53からステップS57までの処理を繰り返してもよいし、並列処理することも可能である。また、ステップS53とステップS54の処理については、図に示す順序で実行する必要はなく、適宜順序を入れ替えてもよい。 Note that the processing in step S52 need not be included in the repetition of the figure. The processes from step S53 to step S57 may be repeated after all patterns are projected and imaged in step S52, or they may be processed in parallel. Moreover, it is not necessary to perform the process of step S53 and step S54 in the order shown to a figure, and you may replace an order suitably.
このように、グレイコードパターン群の特徴と空間的な近傍情報を利用することで、撮像画像に発生したノイズの影響を低減し、三次元座標をさらに高精度に算出することができる。 As described above, by using the features of the gray code pattern group and the spatial neighborhood information, it is possible to reduce the influence of noise generated in the captured image and calculate the three-dimensional coordinates with higher accuracy.
(変形例)
第1の実施形態から第5の実施形態では、いずれも三次元計測を行う例について述べたが、求めた投影座標と撮像座標の対応関係に基づいて、プロジェクションマッピングのための較正を行ってもよい。通常、プロジェクションマッピングにおいてコンテンツを表示する際には撮像装置2は必要無いが、較正時には投影光が投影対象のどの領域に照射されているか対応関係を求める必要がある。そこで撮像装置2を用いて、第1〜5の実施形態のいずれかの方法に基づいて、パターンを投影する様子を撮像し、投影対象に対して投影光のマッピング関係を求めれば良い。
(Modification)
In each of the first to fifth embodiments, an example in which three-dimensional measurement is performed has been described. However, even if calibration for projection mapping is performed based on the correspondence relationship between the obtained projection coordinates and imaging coordinates. Good. Normally, the
(その他の実施形態)
また、本発明は、以下の処理を実行することによっても実現される。
(Other embodiments)
The present invention can also be realized by executing the following processing.
即ち、上述した各実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(又はCPUやMPU等)がプログラムを読み出して実行する処理である。 That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and the computer (or CPU, MPU, etc.) of the system or apparatus reads the program. To be executed.
このプログラム及び当該プログラムを記憶したコンピュータ読み取り可能な記憶媒体は、本発明に含まれる。 This program and a computer-readable storage medium storing the program are included in the present invention.
Claims (9)
前記複数の画像における画素に対して、該画素の輝度に応じたラベルを付与する付与手段と、
前記投影される複数種類のパターンのうちのある1つのパターンにおける明部と暗部との境界が発生する位置では、他のパターンにおいて前記境界が発生しない制約に基づいて、前記付与されたラベルを変更する変更手段と、
前記変更されたラベルに基づいて、前記投影手段の投影面における前記パターンの位置と、前記取得された画像における前記パターンの位置との対応関係を導出する対応関係導出手段と備えることを特徴とする情報処理装置。 Image obtaining means for obtaining a plurality of images obtained by imaging a target object in which a plurality of types of patterns having a bright part and a dark part are projected in time series by the projecting means;
An attaching unit for attaching a label corresponding to the luminance of the pixel to the pixels in the plurality of images;
The given label is changed based on the restriction that the boundary does not occur in another pattern at a position where the boundary between the bright part and the dark part occurs in one of the plurality of types of projected patterns. Change means to
Correspondence relation deriving means for deriving a correspondence relation between the position of the pattern on the projection plane of the projection means and the position of the pattern in the acquired image based on the changed label. Information processing device.
前記複数の画像における画素に対して、該画素の輝度に応じたラベルを付与する付与工程と、
前記投影される複数種類のパターンのうちのある1つのパターンにおける明部と暗部との境界が発生する位置では、他のパターンにおいて前記境界が発生しない制約に基づいて、前記付与されたラベルを変更する変更工程と、
前記変更されたラベルに基づいて、前記投影手段の投影面における前記パターンの位置と、前記取得された画像における前記パターンの位置との対応関係を導出する対応関係導出工程と備えることを特徴とする情報処理方法。 An image acquisition step of acquiring a plurality of images obtained by imaging a target object in which a plurality of types of patterns having a bright part and a dark part are projected in time series by a projecting unit;
An applying step of applying a label corresponding to the luminance of the pixel to the pixels in the plurality of images;
The given label is changed based on the restriction that the boundary does not occur in another pattern at a position where the boundary between the bright part and the dark part occurs in one of the plurality of types of projected patterns. Change process to
And a correspondence derivation step of deriving a correspondence between the position of the pattern on the projection plane of the projection unit and the position of the pattern in the acquired image based on the changed label. Information processing method .
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015033366A JP6571948B2 (en) | 2015-02-23 | 2015-02-23 | Information processing apparatus, information processing method, and program |
US15/048,601 US10032279B2 (en) | 2015-02-23 | 2016-02-19 | Information processing apparatus, information processing method, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015033366A JP6571948B2 (en) | 2015-02-23 | 2015-02-23 | Information processing apparatus, information processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016156655A JP2016156655A (en) | 2016-09-01 |
JP6571948B2 true JP6571948B2 (en) | 2019-09-04 |
Family
ID=56825626
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015033366A Active JP6571948B2 (en) | 2015-02-23 | 2015-02-23 | Information processing apparatus, information processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6571948B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3126462B2 (en) * | 1992-02-13 | 2001-01-22 | 株式会社トキメック | Boundary extraction method and apparatus |
JP2005352835A (en) * | 2004-06-11 | 2005-12-22 | Brother Ind Ltd | Image i/o device |
KR101974651B1 (en) * | 2011-06-22 | 2019-05-02 | 성균관대학교산학협력단 | Measuring method of 3d image depth and a system for measuring 3d image depth using boundary inheritance based hierarchical orthogonal coding |
-
2015
- 2015-02-23 JP JP2015033366A patent/JP6571948B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2016156655A (en) | 2016-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6795993B2 (en) | Shape measurement system, shape measurement device and shape measurement method | |
US10032279B2 (en) | Information processing apparatus, information processing method, and storage medium | |
US8964189B2 (en) | Three-dimensional measurement apparatus, method for three-dimensional measurement, and computer program | |
US8811767B2 (en) | Structured light for 3D shape reconstruction subject to global illumination | |
US9530215B2 (en) | Systems and methods for enhanced depth map retrieval for moving objects using active sensing technology | |
JP6480902B2 (en) | Projection pattern creation device and three-dimensional measurement device | |
US10006762B2 (en) | Information processing apparatus, information processing method, and storage medium | |
JP6097282B2 (en) | 3D scanner with structured illumination | |
JP6161276B2 (en) | Measuring apparatus, measuring method, and program | |
EP3002550B1 (en) | Information processing system and information processing method for distance measurement | |
CN109099860B (en) | Three-dimensional geometry measuring device and three-dimensional geometry measuring method | |
JP5032889B2 (en) | Three-dimensional measurement method and apparatus using spatial coding method | |
JP5277986B2 (en) | Arithmetic device, arithmetic program, surface shape measuring device, and surface shape measuring method | |
JP2017003331A (en) | Measurement device for measuring a shape of a body to be measured, calculation device, and calculation method and program | |
JP6477348B2 (en) | Self-position estimation apparatus and self-position estimation method | |
JP6571947B2 (en) | Information processing apparatus, information processing method, and program | |
JP6571948B2 (en) | Information processing apparatus, information processing method, and program | |
CN112233139A (en) | System and method for detecting motion during 3D data reconstruction | |
Luo et al. | Deep learning-enabled invalid-point removal for spatial phase unwrapping of 3D measurement | |
US9158956B2 (en) | Reader, reading method and computer program product | |
JP5452035B2 (en) | Defect inspection method and defect inspection apparatus | |
US20160273913A1 (en) | Measurement apparatus | |
Sadatsharifi et al. | Locally adaptive thresholding for single-shot structured light patterns | |
US11636614B2 (en) | Three-dimensional geometry measurement apparatus and three-dimensional geometry measurement method | |
JP7390239B2 (en) | Three-dimensional shape measuring device and three-dimensional shape measuring method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180222 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20181130 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20181218 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190214 |
|
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: 20190716 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190809 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6571948 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |