decode_structured_light_pattern🔗
説明🔗
decode_structured_light_pattern — ストラクチャー照明セットアップにより取得したカメラ画像を復号する。
書式🔗
decode_structured_light_pattern( image CameraImages, structured_light_model StructuredLightModel )
説明🔗
decode_structured_light_pattern はストラクチャー照明セットアップで
事前に取得したカメラ画像 CameraImages を復号します。復号処理で
作成される対応画像とその他の中間結果はモデル StructuredLightModel
に格納され、オペレーター get_structured_light_object を使用して
後からアクセスできます。
以下に、復号処理の詳細を説明します:
gen_structured_light_pattern で述べたように第一の目的は、画素が明るい縞で照らされた領域にあるか、
もしくは暗い縞で照らされた領域にあるかをを調べることです。
この決定処理を簡単化するために正規化画像が使用され、反射率や明るさ、照明条件が変化する
物体に対処するために局所的に変化するしきい値が決定さます。
取得したすべてのカメラ画像の復号の間、グレイコード画像は事前に計算された
しきい値と比較されます。画像中の画素はそのグレイ値がこのしきい値以上だった
場合に明るいと分類されます。
さらに、パターン領域は復号処理で分割されます。分割処理はパラメーター
'min_gray_difference' で制御されます
(set_structured_light_model_paramを参照してください)。
n枚のグレイコード画像が処理されると仮定すると、各ピクセルにnビットのバイナリー 符号が得られます。この結果からモニターかプロジェクタの行と列の座標は \('\textit{min\_stripe\_width}'/2\) まで得ることができます。
StructuredLightModel はグレイコード画像だけでなく位相シフト画像から
なるハイブリットシステムである場合 (gen_structured_light_patternを
参照してください) 、次の手順はモニターかプロジェクタ座標と、カメラ座標の間のモニターかプロジェクタ画素を、
観測したカメラ画素の情報を含むサブピクセル精度の対応関係を復号することです。
StructuredLightModelの 'pattern_type'が 'single_stripe'
に設定されている場合、デコード処理の最初のステップは、どの単一ストライプがカメラの
ピクセルに光を当てるかを決定します。次に、グレイコードシーケンスおよび位相を使用して、
見つかった単一ストライプ内の位置を精緻化します。
実世界のセットアップでは、検出された画素のグレイコードの結果が誤っていること があります。これによりモニターかプロジェクタの行と列を表す対応画像中でモニターかプロジェクタの幅と高さ よりも大きい値が得られます。これらの問題を回避するために、復号処理の最後の手順 は対応画像からこれらの値を削除することです。
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
-
並列演算処理には未対応
このオペレータは以下の入力パラメータの状態を変更します :
このパラメータの値は外部同期なしには複数スレッド間で共有されません。
パラメーター🔗
CameraImages (input_object) (multichannel-)image(-array) → object (byte / uint2)
取得されたカメラ画像
StructuredLightModel (input_control, 状態が変更されました) structured_light_model → (handle)
ストラクチャー照明モデルのハンドル
例🔗
(HDevelop)
* Create the model
create_structured_light_model ('deflectometry', StructuredLightModel)
* Set the size of the monitor
set_structured_light_model_param (StructuredLightModel, \
'pattern_width', 1600)
set_structured_light_model_param (StructuredLightModel, \
'pattern_height', 1200)
* Set the smallest width of the stripes in the pattern
set_structured_light_model_param (StructuredLightModel, \
'min_stripe_width', 8)
* Generate the patterns to project
gen_structured_light_pattern (PatternImages, StructuredLightModel)
* Set the expected black/white contrast in the region of interest
set_structured_light_model_param (StructuredLightModel, \
'min_gray_difference', 70)
* Decode the camera images
decode_structured_light_pattern (CameraImages, StructuredLightModel)
* Get the computed correspondences and defects
get_structured_light_object (CorrespondenceImages, StructuredLightModel, \
'correspondence_image')
set_structured_light_model_param (StructuredLightModel, 'derivative_sigma', \
Sigma)
get_structured_light_object (DefectImage, StructuredLightModel, \
'defect_image')
結果🔗
与えられたパラメーターが有効だった場合、オペレーター decode_structured_light_pattern
は2 (H_MSG_TRUE)の値を返します。そうでない場合は、例外が発生します。
他のオペレーターとの組み合わせ🔗
組み合わせ
前処理の候補
後処理の候補
get_structured_light_object, reconstruct_surface_structured_light
関連項目
create_structured_light_model, set_structured_light_model_param
モジュール🔗
3D Metrology