Skip to content

get_training_componentsGetTrainingComponentsGetTrainingComponentsget_training_componentsT_get_training_components🔗

説明🔗

get_training_componentsGetTrainingComponentsGetTrainingComponentsget_training_componentsT_get_training_components — ある画像内の初期のまたはモデルの部品を返す。

警告🔗

get_training_componentsGetTrainingComponentsは現在では使用されず、下位互換性のためだけに提供されます。 このオペレータはHALCON 26.11で削除予定です。

書式🔗

get_training_components( out region TrainingComponents, component_training ComponentTrainingID, string Components, string Image, string MarkOrientation, out point.y Row, out point.x Column, out angle.rad Angle, out real Score )void GetTrainingComponents( HObject* TrainingComponents, const HTuple& ComponentTrainingID, const HTuple& Components, const HTuple& Image, const HTuple& MarkOrientation, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Score )static void HOperatorSet.GetTrainingComponents( out HObject trainingComponents, HTuple componentTrainingID, HTuple components, HTuple image, HTuple markOrientation, out HTuple row, out HTuple column, out HTuple angle, out HTuple score )def get_training_components( component_training_id: HHandle, components: Union[str, int], image: Union[str, int], mark_orientation: str ) -> Tuple[HObject, Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def get_training_components_s( component_training_id: HHandle, components: Union[str, int], image: Union[str, int], mark_orientation: str ) -> Tuple[HObject, float, float, float, float]Herror T_get_training_components( Hobject* TrainingComponents, const Htuple ComponentTrainingID, const Htuple Components, const Htuple Image, const Htuple MarkOrientation, Htuple* Row, Htuple* Column, Htuple* Angle, Htuple* Score )

HRegion HComponentTraining::GetTrainingComponents( const HTuple& Components, const HTuple& Image, const HString& MarkOrientation, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Score ) const

HRegion HComponentTraining::GetTrainingComponents( const HString& Components, const HString& Image, const HString& MarkOrientation, double* Row, double* Column, double* Angle, double* Score ) const

HRegion HComponentTraining::GetTrainingComponents( const char* Components, const char* Image, const char* MarkOrientation, double* Row, double* Column, double* Angle, double* Score ) const

HRegion HComponentTraining::GetTrainingComponents( const wchar_t* Components, const wchar_t* Image, const wchar_t* MarkOrientation, double* Row, double* Column, double* Angle, double* Score ) const (Windows only)

HRegion HComponentTraining.GetTrainingComponents( HTuple components, HTuple image, string markOrientation, out HTuple row, out HTuple column, out HTuple angle, out HTuple score )

HRegion HComponentTraining.GetTrainingComponents( string components, string image, string markOrientation, out double row, out double column, out double angle, out double score )

説明🔗

get_training_componentsGetTrainingComponents はすべての初期の部品( Componentscomponentscomponents \(=\) 'initial_components'"initial_components" の場合)、ま たはすべてのモデルの部品(Componentscomponentscomponents \(=\) 'model_components'"model_components" の場合)を TrainingComponentstrainingComponentstraining_components に輪郭領域の形式と数値の形式で返しま す。または、初期の部品のインデックスを直接渡すことで、初期の 部品の見つかったすべての姿勢(つまり、 train_model_componentsTrainModelComponents におけるあいまい性を解決する前の姿 勢)を返します。

返される部品の姿勢は、モデル画像中(Imageimageimage \(=\) 'model_image'"model_image" または Imageimageimage \(=\) 00)、ま たはトレーニング画像中(Imageimageimage >= 11 の 場合)の姿勢に対応します。i番目の画像中で見つかった部品の 姿勢における部品を得るために、Imageimageimage は i を設定する必 要があります。さらに、回転について対称な部品を扱う際に、見つかった 部品の現在の方向をマークすることが要求されるかもしれません。これ は MarkOrientationmarkOrientationmark_orientation を 'true'"true" に設定することで実 現できます。この場合、各部品の輪郭領域は、参照方向で位置付けられた その参照点上で、矢印によって補足されます。部品の参照方向は、モデル 画像における部品の方向をもとにしており、参照点から始まり、水平方向 右向きの矢印によって表現されます。

輪郭領域に加え、すべての部品の姿勢とスコアが Rowrowrow、 Columncolumncolumn、Angleangleangle、および Scorescorescore に返されま す(find_shape_modelFindShapeModel を参照してください)。 Componentscomponentscomponents を 'initial_components'"initial_components" または 'model_components'"model_components" に設定すると、 TrainingComponentstrainingComponentstraining_components、Rowrowrow、Columncolumncolumn、 Angleangleangle、および Scorescorescore の各 tuple には、常に ComponentTrainingIDcomponentTrainingIDcomponent_training_id に含まれる初期の部品またはモデル部品 と同数の要素が含まれます。もし画像中で1つの部品が見つからない場 合、空の領域が TrainingComponentstrainingComponentstraining_components の対応する要素に返さ れ、4つの出力制御パラメーターの要素が 00 に設定されます。 これに対し、もし初期の部品のインデックスが Componentscomponentscomponents に 渡される場合、これらの tuple は、画像中で見つかった対応する初期の 部品の適合として多くの要素を含みます。

オペレーター get_training_componentsGetTrainingComponents は train_model_componentsTrainModelComponents によって実行されたトレーニング ComponentTrainingIDcomponentTrainingIDcomponent_training_id の結果を視覚的に表現するためには非常 に有用です。これを用いて、トレーニング画像が適しているかどうか評価 したり、train_model_componentsTrainModelComponents のパラメーターの影響を検査 したりすることが可能になります。時として、異なるトレーニング画像集 合を用いた場合やパラメーターの調整をした後には、 train_model_componentsTrainModelComponents で再びトレーニングすることが適切な 場合もあります。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

TrainingComponentstrainingComponentstraining_components (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

初期の部品、またはモデルの部品の輪郭領域

ComponentTrainingIDcomponentTrainingIDcomponent_training_id (input_control) component_training → (handle)HTuple (HHandle)HComponentTraining, HTuple (IntPtr)HHandleHtuple (handle)

トレーニング結果のハンドル

Componentscomponentscomponents (input_control) string → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)Union[str, int]Htuple (char* / Hlong)

返される部品のタイプまたは初期の部品のインデックス

初期値: 'model_components'"model_components"
推奨値: 'model_components', 'initial_components', 0, 1, 2, 3, 4, 5"model_components", "initial_components", 0, 1, 2, 3, 4, 5

Imageimageimage (input_control) string → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)Union[str, int]Htuple (char* / Hlong)

部品が返される画像

初期値: 'model_image'"model_image"
推奨値: 'model_image', 0, 1, 2, 3, 4, 5, 6, 7, 8"model_image", 0, 1, 2, 3, 4, 5, 6, 7, 8

MarkOrientationmarkOrientationmark_orientation (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

部品の方向のマーク

初期値: 'false'"false"
値のリスト: 'false', 'true'"false", "true"

Rowrowrow (output_control) point.y(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

すべての初期の部品またはモデルの部品の見つかったイン スタンスの行座標

Columncolumncolumn (output_control) point.x(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

すべての初期の部品またはモデルの部品の見つかったイン スタンスの列座標

Angleangleangle (output_control) angle.rad(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

すべての部品のインスタンスの回転角度

Scorescorescore (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

すべての部品のインスタンスのスコア

結果🔗

トレーニング結果のハンドルが有効であれば、オペレーター get_training_componentsGetTrainingComponents は、値 2 (H_MSG_TRUE) を返します。必要に応じ て、例外処理が発生します。

モジュール🔗

Matching