説明
find_deformable_surface_modelFindDeformableSurfaceModelFindDeformableSurfaceModelfind_deformable_surface_modelT_find_deformable_surface_model — 3D シーン内の可変形状サーフェスモデルに最も一致するものを検出する。
書式
find_deformable_surface_model( deformable_surface_model DeformableSurfaceModel, object_model_3d ObjectModel3D, real RelSamplingDistance, real MinScore, attribute.name GenParamName, attribute.value GenParamValue, out real Score, out deformable_surface_matching_result DeformableSurfaceMatchingResult )void FindDeformableSurfaceModel( const HTuple& DeformableSurfaceModel, const HTuple& ObjectModel3D, const HTuple& RelSamplingDistance, const HTuple& MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Score, HTuple* DeformableSurfaceMatchingResult )static void HOperatorSet.FindDeformableSurfaceModel( HTuple deformableSurfaceModel, HTuple objectModel3D, HTuple relSamplingDistance, HTuple minScore, HTuple genParamName, HTuple genParamValue, out HTuple score, out HTuple deformableSurfaceMatchingResult )def find_deformable_surface_model( deformable_surface_model: HHandle, object_model_3d: HHandle, rel_sampling_distance: float, min_score: Union[float, int], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, float, int]] ) -> Tuple[Sequence[float], Sequence[HHandle]]
def find_deformable_surface_model_s( deformable_surface_model: HHandle, object_model_3d: HHandle, rel_sampling_distance: float, min_score: Union[float, int], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, float, int]] ) -> Tuple[float, HHandle]Herror T_find_deformable_surface_model( const Htuple DeformableSurfaceModel, const Htuple ObjectModel3D, const Htuple RelSamplingDistance, const Htuple MinScore, const Htuple GenParamName, const Htuple GenParamValue, Htuple* Score, Htuple* DeformableSurfaceMatchingResult )
HTuple HObjectModel3D::FindDeformableSurfaceModel( const HDeformableSurfaceModel& DeformableSurfaceModel, double RelSamplingDistance, const HTuple& MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResultArray* DeformableSurfaceMatchingResult ) const
double HObjectModel3D::FindDeformableSurfaceModel( const HDeformableSurfaceModel& DeformableSurfaceModel, double RelSamplingDistance, double MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResult* DeformableSurfaceMatchingResult ) const
HTuple HDeformableSurfaceModel::FindDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResultArray* DeformableSurfaceMatchingResult ) const
double HDeformableSurfaceModel::FindDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, double MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResult* DeformableSurfaceMatchingResult ) const
static HTuple HDeformableSurfaceMatchingResult::FindDeformableSurfaceModel( const HDeformableSurfaceModel& DeformableSurfaceModel, const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResultArray* DeformableSurfaceMatchingResult )
double HDeformableSurfaceMatchingResult::FindDeformableSurfaceModel( const HDeformableSurfaceModel& DeformableSurfaceModel, const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, double MinScore, const HTuple& GenParamName, const HTuple& GenParamValue )
HTuple HObjectModel3D.FindDeformableSurfaceModel( HDeformableSurfaceModel deformableSurfaceModel, double relSamplingDistance, HTuple minScore, HTuple genParamName, HTuple genParamValue, out HDeformableSurfaceMatchingResult[] deformableSurfaceMatchingResult )
double HObjectModel3D.FindDeformableSurfaceModel( HDeformableSurfaceModel deformableSurfaceModel, double relSamplingDistance, double minScore, HTuple genParamName, HTuple genParamValue, out HDeformableSurfaceMatchingResult deformableSurfaceMatchingResult )
HTuple HDeformableSurfaceModel.FindDeformableSurfaceModel( HObjectModel3D objectModel3D, double relSamplingDistance, HTuple minScore, HTuple genParamName, HTuple genParamValue, out HDeformableSurfaceMatchingResult[] deformableSurfaceMatchingResult )
double HDeformableSurfaceModel.FindDeformableSurfaceModel( HObjectModel3D objectModel3D, double relSamplingDistance, double minScore, HTuple genParamName, HTuple genParamValue, out HDeformableSurfaceMatchingResult deformableSurfaceMatchingResult )
static HTuple HDeformableSurfaceMatchingResult.FindDeformableSurfaceModel( HDeformableSurfaceModel deformableSurfaceModel, HObjectModel3D objectModel3D, double relSamplingDistance, HTuple minScore, HTuple genParamName, HTuple genParamValue, out HDeformableSurfaceMatchingResult[] deformableSurfaceMatchingResult )
double HDeformableSurfaceMatchingResult.FindDeformableSurfaceModel( HDeformableSurfaceModel deformableSurfaceModel, HObjectModel3D objectModel3D, double relSamplingDistance, double minScore, HTuple genParamName, HTuple genParamValue )
説明
オペレーター find_deformable_surface_modelFindDeformableSurfaceModel は、3D シーン
ObjectModel3DobjectModel3Dobject_model_3d 内の可変形状サーフェスモデル
DeformableSurfaceModeldeformableSurfaceModeldeformable_surface_model に最も一致するものを検出します。
可変形状サーフェスモデルは、create_deformable_surface_modelCreateDeformableSurfaceModel な
どを使用して前もって作成しておく必要があります。
マッチングを行うには、3D オブジェクトモデル
ObjectModel3DobjectModel3Dobject_model_3d に点と法線が含まれている必要があります。
シーンは以下の選択肢のうちのどれか1つに該当していなければなりません:
正確な姿勢を得るには、シーンとモデルの法線が同じ方向を向いていることが重要です
('scene_invert_normals'"scene_invert_normals" を参照)。
シーンの三角メッシュまたはポリゴンは無視されることに注意してくださ
い。代わりに、マッチングでは頂点のみが使用されます。
したがって、一般には、CAD データなどのメッシュされたシーンでは、この
オペレーターの使用はお勧めしません。
代わりに、sample_object_model_3dSampleObjectModel3d を使用して事前にこのよう
なシーンをサンプリングし、点と法線を作成する必要があります。
Time-of-Flightカメラなどから得られたノイズの多い点列データを使用する場合、
より安定性の高い結果を得るには、汎用パラメーター
'scene_normal_computation'"scene_normal_computation" に 'mls'"mls" を設定する必
要があります(以下を参照)。
まず、点群は ObjectModel3DobjectModel3Dobject_model_3d に渡されたシーンから均一に
サンプリングされます。サンプリングする距離はパラメータ RelSamplingDistancerelSamplingDistancerel_sampling_distance
により制御されており、サーフェスモデルの直径に対する相対値で与えられます。
RelSamplingDistancerelSamplingDistancerel_sampling_distance を減少させることはより多くの点をサンプリングする
ことになり、さらに、マッチングが安定するものの処理は遅くなります。
RelSamplingDistancerelSamplingDistancerel_sampling_distance を増加させることはサンプリングするシーンの点数を
減らすことになり、マッチングは少し不安定になりますが、処理は速くなります。
オペレータ get_deformable_surface_matching_resultGetDeformableSurfaceMatchingResult は視覚的に検証
するためにサンプリングされたシーンの点群を検索することに使用されます。
安定したマッチングのために、各オブジェクトインスタンス毎に、少なくとも 50~100の
シーン点群がサンプリングされるように調整することを推奨します。
この手法では初めにオブジェクトのおおよその位置を見つけます。
そしてこの位置を最適化します。
変形をコントロールする一般パラメータについてはさらに下で記述します。
マッチングできた場合、マッチングスコアは Scorescorescore に返されます。
そして、可変サーフェスマッチングの結果ハンドルが DeformableSurfaceMatchingResultdeformableSurfaceMatchingResultdeformable_surface_matching_result
に返されます。
変形したモデルや参照点の位置などマッチングの結果の詳細については
オペレータ get_deformable_surface_matching_resultGetDeformableSurfaceMatchingResult で
結果ハンドルを使用することで問い合わせることができます。
スコアは、00 と 11 の間で正規化され、シーンに表示さ
れるモデルサーフェスの量を表します。11 の値は完全マッチングを表
します。
パラメーター MinScoreminScoremin_score を使用して、結果をフィルタリングで
きます。
マッチングは、スコアが MinScoreminScoremin_score 値を超えている場合にのみ
返されます。
パラメーター GenParamNamegenParamNamegen_param_name と GenParamValuegenParamValuegen_param_value を使
用して、汎用パラメーターを設定できます。どちらも同じ長さの tuple
を設定する必要があります。GenParamNamegenParamNamegen_param_name に渡される tuple には設定する
パラメーターの名前、GenParamValuegenParamValuegen_param_value に渡される tuple には対
応する値が含まれます。取り得るパラメーターを以下に記述します。
-
'scene_normal_computation'"scene_normal_computation":
このパラメーターは、サンプリングされたシーンの法線の計算を制御しま
す。
デフォルトモード 'fast'"fast" では、法線は、点の小さい近傍に
基づいて計算されます。
モード 'mls'"mls" では、法線は、計算量は多いですが正確な
'mls'"mls" メソッドを使用して、広い近傍に基づいて計算され
ます。
'mls'"mls" メソッドのより詳細な記述は、オペレーター
surface_normals_object_model_3dSurfaceNormalsObjectModel3d の記述を参照してくださ
い。
'mls'"mls" モードは、Time-of-Flightカメラの画像などのノイズのあ
るデータ向けに用いられます。
値のリスト:'fast'"fast"、'mls'"mls"
初期値: 'fast'"fast"
-
'scene_invert_normals'"scene_invert_normals":
シーンの表面法線の方向を反転します。
シーンの表面法線の向きは、モデルの向きと一致する必要があります。
モデルとシーンの両方が同じ環境で取得された場合、法線はすでに同じ方向を向いています。
モデルがシーン表面の「外側」に見つかってしまう場合はこのパラメーターを'true'"true"
に設定することをお試しください。
また、シーン内のすべての法線が外側または内側のいずれかを指していること、
つまり、向きが統一されていることを確認してください。
値のリスト:'false'"false"、'true'"true"
初期値: 'false'"false"
-
'pose_ref_num_steps'"pose_ref_num_steps":
精密姿勢修正の繰り返しの回数です。繰り返しの回数を増やすと、
実行時間は長くなりますが、姿勢の精度は高くなります。
ただし、収束に達すると、手順の数を増やしても、精度はそれ以上
高くなりません。
推奨値: 11, 1010, 2525,
5050
初期値: 2525
制限: 'pose_ref_num_steps'"pose_ref_num_steps" > 00
-
'pose_ref_dist_threshold_rel'"pose_ref_dist_threshold_rel":
精密姿勢修正に使用される点間距離のしきい値を、サーフェスモデルの
境界矩形対角線に対する比率で設定します。オブジェクトまでの距離が
この距離より近いシーン点だけが最適化に使用されます。
この距離より遠いシーン点は無視されます。
推奨値: 0.050.05, 0.10.1,
0.250.25, 0.30.3
初期値: 0.250.25
制限: 00 < 'pose_ref_dist_threshold_rel'"pose_ref_dist_threshold_rel"
-
'pose_ref_dist_threshold_abs'"pose_ref_dist_threshold_abs":
絶対値として精密姿勢修正に使用される点間距離のしきい値を設定します。
詳細については 'pose_ref_dist_threshold_rel'"pose_ref_dist_threshold_rel" を参照してください。
パラメーター 'pose_ref_dist_threshold_rel'"pose_ref_dist_threshold_rel" と
'pose_ref_dist_threshold_abs'"pose_ref_dist_threshold_abs" のどちらか一方のみを設定できます。
もし両方が設定された場合、最後のパラメーターの値のみが使用されます。
制限: 00 < 'pose_ref_dist_threshold_abs'"pose_ref_dist_threshold_abs"
-
'pose_ref_scoring_dist_rel'"pose_ref_scoring_dist_rel":
スコアリングの距離のしきい値を、サーフェスモデルの境界矩形対角線に
対する比率で設定します。詳細については、以下の
'pose_ref_scoring_dist_abs'"pose_ref_scoring_dist_abs" を参照してください。
パラメーター 'pose_ref_scoring_dist_rel'"pose_ref_scoring_dist_rel" と
'pose_ref_scoring_dist_abs'"pose_ref_scoring_dist_abs" のどちらか一方のみを
設定できます。もし両方が設定された場合、最後のパラメータの値のみが使用されます。
推奨値: 0.10.1, 0.050.05,
0.030.03, 0.0050.005
初期値: 0.030.03
制限: 00 < 'pose_ref_scoring_dist_rel'"pose_ref_scoring_dist_rel"
-
'pose_ref_scoring_dist_abs'"pose_ref_scoring_dist_abs":
スコアリングの距離のしきい値を、絶対値で設定します。
姿勢修正後のスコア計算では、オブジェクトまでの距離がこの距離より
近いシーン点だけが「モデル上にある」と見なされます。その他の
シーン点はモデル上にはないと見なされます。
値は、シーン点の座標上のノイズの量に対応している必要があります。
精密姿勢修正が無効な場合、このパラメーターは無視されます。
パラメーター 'pose_ref_scoring_dist_rel'"pose_ref_scoring_dist_rel" と
'pose_ref_scoring_dist_abs'"pose_ref_scoring_dist_abs" のどちらか一方のみを
設定できます。もし両方が設定された場合、最後のパラメータの値のみが使用されます。
制限: 00 < 'pose_ref_scoring_dist_abs'"pose_ref_scoring_dist_abs"
実行情報
実行情報
このオペレータはハンドルを返します。このハンドルタイプのインスタンスの状態は、特定のオペレータにおいては、入力パラメータとして使われている場合であっても変更されることがあります。
このオペレータは、タイムアウトと割り込みのキャンセルをサポートします。
パラメーター
DeformableSurfaceModeldeformableSurfaceModeldeformable_surface_model (input_control) deformable_surface_model → (handle)HTuple (HHandle)HDeformableSurfaceModel, HTuple (IntPtr)HHandleHtuple (handle)
可変形状サーフェスモデルのハンドル
ObjectModel3DobjectModel3Dobject_model_3d (input_control) object_model_3d → (handle)HTuple (HHandle)HObjectModel3D, HTuple (IntPtr)HHandleHtuple (handle)
シーンを含む 3D オブジェクトモデルのハン
ドル
RelSamplingDistancerelSamplingDistancerel_sampling_distance (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)
サーフェスモデルの直径に対するシーンサンプリン
グ距離
初期値: 0.050.05
推奨値: 0.1, 0.07, 0.05, 0.04, 0.030.1, 0.07, 0.05, 0.04, 0.03
制限: 0 < RelSamplingDistance < 1
MinScoreminScoremin_score (input_control) real → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)
返されるマッチングの最小スコア
初期値: 00
制限: MinScore >= 0
GenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)
一般パラメーターの名前
初期値: [][]
値のリスト: 'pose_ref_dist_threshold_abs', 'pose_ref_dist_threshold_rel', 'pose_ref_num_steps', 'pose_ref_scoring_dist_abs', 'pose_ref_scoring_dist_rel', 'scene_invert_normals', 'scene_normal_computation'"pose_ref_dist_threshold_abs", "pose_ref_dist_threshold_rel", "pose_ref_num_steps", "pose_ref_scoring_dist_abs", "pose_ref_scoring_dist_rel", "scene_invert_normals", "scene_normal_computation"
GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (string / real / integer)HTuple (HString / double / Hlong)HTuple (string / double / int / long)Sequence[Union[str, float, int]]Htuple (char* / double / Hlong)
一般パラメーターの値
初期値: [][]
推奨値: 'fast', 'mls', 0, 1, 10, 25, 50, 0.05, 0.1, 0.25, 0.3, 0.05, 0.03, 0.005"fast", "mls", 0, 1, 10, 25, 50, 0.05, 0.1, 0.25, 0.3, 0.05, 0.03, 0.005
Scorescorescore (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
見つかったサーフェスモデルのインスタンスのス
コア
DeformableSurfaceMatchingResultdeformableSurfaceMatchingResultdeformable_surface_matching_result (output_control) deformable_surface_matching_result(-array) → (handle)HTuple (HHandle)HDeformableSurfaceMatchingResult, HTuple (IntPtr)Sequence[HHandle]Htuple (handle)
マッチング結果のハンドル
結果
find_deformable_surface_modelFindDeformableSurfaceModel は、すべてのパラメーターが正
しい場合に 2 (H_MSG_TRUE) を返します。必要に応じて、例外が発生します。
他のオペレーターとの組み合わせ
組み合わせ
前処理の候補
read_object_model_3dReadObjectModel3d, xyz_to_object_model_3dXyzToObjectModel3d, get_object_model_3d_paramsGetObjectModel3dParams, read_deformable_surface_modelReadDeformableSurfaceModel, create_deformable_surface_modelCreateDeformableSurfaceModel, get_deformable_surface_model_paramGetDeformableSurfaceModelParam, add_deformable_surface_model_reference_pointAddDeformableSurfaceModelReferencePoint, add_deformable_surface_model_sampleAddDeformableSurfaceModelSample
後処理の候補
refine_deformable_surface_modelRefineDeformableSurfaceModel, get_deformable_surface_matching_resultGetDeformableSurfaceMatchingResult, clear_deformable_surface_matching_resultClearDeformableSurfaceMatchingResult, clear_object_model_3dClearObjectModel3d
他の選択候補
refine_deformable_surface_modelRefineDeformableSurfaceModel
関連項目
refine_deformable_surface_modelRefineDeformableSurfaceModel
モジュール
3D Metrology