cluster_model_componentsClusterModelComponentsClusterModelComponentscluster_model_componentsT_cluster_model_components
説明
cluster_model_componentsClusterModelComponentsClusterModelComponentscluster_model_componentsT_cluster_model_components — モデル部品を生成するために使用される新しいパラメーターをトレーニン
グ結果に適用する。
警告
cluster_model_componentsClusterModelComponentsは現在では使用されず、下位互換性のためだけに提供されます。
このオペレータはHALCON 26.11で削除予定です。
書式
cluster_model_components( image TrainingImages, out region ModelComponents, component_training ComponentTrainingID, string AmbiguityCriterion, real MaxContourOverlap, real ClusterThreshold )void ClusterModelComponents( const HObject& TrainingImages, HObject* ModelComponents, const HTuple& ComponentTrainingID, const HTuple& AmbiguityCriterion, const HTuple& MaxContourOverlap, const HTuple& ClusterThreshold )static void HOperatorSet.ClusterModelComponents( HObject trainingImages, out HObject modelComponents, HTuple componentTrainingID, HTuple ambiguityCriterion, HTuple maxContourOverlap, HTuple clusterThreshold )def cluster_model_components( training_images: HObject, component_training_id: HHandle, ambiguity_criterion: str, max_contour_overlap: float, cluster_threshold: float ) -> HObject
Herror T_cluster_model_components( const Hobject TrainingImages, Hobject* ModelComponents, const Htuple ComponentTrainingID, const Htuple AmbiguityCriterion, const Htuple MaxContourOverlap, const Htuple ClusterThreshold )
HRegion HComponentTraining::ClusterModelComponents( const HImage& TrainingImages, const HString& AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold ) const
HRegion HComponentTraining::ClusterModelComponents( const HImage& TrainingImages, const char* AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold ) const
HRegion HComponentTraining::ClusterModelComponents( const HImage& TrainingImages, const wchar_t* AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold ) const (Windows only)
HRegion HImage::ClusterModelComponents( const HComponentTraining& ComponentTrainingID, const HString& AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold ) const
HRegion HImage::ClusterModelComponents( const HComponentTraining& ComponentTrainingID, const char* AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold ) const
HRegion HImage::ClusterModelComponents( const HComponentTraining& ComponentTrainingID, const wchar_t* AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold ) const (Windows only)
HRegion HComponentTraining.ClusterModelComponents( HImage trainingImages, string ambiguityCriterion, double maxContourOverlap, double clusterThreshold )
HRegion HImage.ClusterModelComponents( HComponentTraining componentTrainingID, string ambiguityCriterion, double maxContourOverlap, double clusterThreshold )
説明
オペレーター cluster_model_componentsClusterModelComponents を使用することで、オ
ペレーター train_model_componentsTrainModelComponents によって行われた初期ト
レーニング後にパラメーターを修正することができます。オペ
レーター cluster_model_componentsClusterModelComponents は、あいまいさを解決する
ために使用する基準 AmbiguityCriterionambiguityCriterionambiguity_criterion 輪郭領域の最大重な
りの度合い MaxContourOverlapmaxContourOverlapmax_contour_overlap、およびトレーニング結果
ComponentTrainingIDcomponentTrainingIDcomponent_training_id のクラスタしきい値を指定した値に設定
します。これらのパラメーターの詳細な記述は、オペレーター
train_model_componentsTrainModelComponents のドキュメント内にあります。これら
のパラメーターを修正することによって、初期の部品が剛体モデル部品へ
と結合される方法が変化します。例えば、クラスタしきい値をより大きく
選べば選ぶほど、いくつかの初期の部品は結合されやすくなります。
オペレーター inspect_clustered_componentsInspectClusteredComponents を異なる
パラメーター値で繰り返し呼び出すことで、最適なパラメーターを設定する
ことができ、その後、オペレーター get_training_componentsGetTrainingComponents を
使用することによって選んだ値に設定することができます。
剛体モデル部品は、ModelComponentsmodelComponentsmodel_components に返されます。適切な
結果を得るためには、オペレーター
train_model_componentsTrainModelComponents によってトレーニングに使用された画
像と同じトレーニング画像を TrainingImagestrainingImagestraining_images に渡しておくこ
とが必要不可欠です。トレーニング画像内の新しくクラスタ化された部品
の姿勢は、形状ベースモデルマッチングを用いて決定されます。
train_model_componentsTrainModelComponents 内にあるように、
set_system('pregenerate_shape_models',...) を使用すること
で、形状モデルを事前に生成しておくべきかどうかを決定することができ
ます。ある階層のピラミッドレベルでモデルが画像の境界線に触れた場合、
モデルが元の画像内に完全に含まれていてもモデルが見つからないことがあります。
set_system('border_shape_models',...) は、モデルがト
レーニング画像内に完全に収まっている必要があるか、また画像境界を部
分的に超えてもいいかの決定に使用することができます。
実行情報
実行情報
パラメーター
TrainingImagestrainingImagestraining_images (input_object) (multichannel-)image(-array) → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)
モデル部品をトレーニングするために使用されるトレー ニング画像
ModelComponentsmodelComponentsmodel_components (output_object) region(-array) → objectHObjectHRegionHObjectHobject *
剛体モデル部品の輪郭領域
ComponentTrainingIDcomponentTrainingIDcomponent_training_id (input_control) component_training → (handle)HTuple (HHandle)HComponentTraining, HTuple (IntPtr)HHandleHtuple (handle)
トレーニング結果のハンドル
AmbiguityCriterionambiguityCriterionambiguity_criterion (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
あいまいさを解決するための基準。
初期値: 'rigidity'"rigidity"
値のリスト: 'distance', 'distance_orientation', 'orientation', 'rigidity'"distance", "distance_orientation", "orientation", "rigidity"
MaxContourOverlapmaxContourOverlapmax_contour_overlap (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)
見つかった初期の部品の輪郭領域の重なりを許容する割合
初期値: 0.20.2
推奨値: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.00.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
最小増分: 0.01
推奨増分: 0.05
制限: 0 <= MaxContourOverlap && MaxContourOverlap <= 1
ClusterThresholdclusterThresholdcluster_threshold (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)
最初の部品に対するクラスタしきい値
初期値: 0.50.5
推奨値: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.00.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
制限: 0 <= ClusterThreshold && ClusterThreshold <= 1
結果
パラメーター値が正しいならば、オペレーター
cluster_model_componentsClusterModelComponents は値 2 (H_MSG_TRUE) を返します。入力が空で
ある(入力画像が利用できない)場合、
set_system('no_object_result',<Result>) を通じて設定されま
す。必要に応じて、例外が発生します。
モジュール
Matching