get_found_component_modelGetFoundComponentModelGetFoundComponentModelget_found_component_modelT_get_found_component_model
説明
get_found_component_modelGetFoundComponentModelGetFoundComponentModelget_found_component_modelT_get_found_component_model — 部品モデルの検出した要素の部品を返す。
警告
get_found_component_modelGetFoundComponentModelは現在では使用されず、下位互換性のためだけに提供されます。
このオペレータはHALCON 26.11で削除予定です。
書式
get_found_component_model( out region FoundComponents, component_model ComponentModelID, integer ModelStart, integer ModelEnd, point.y RowComp, point.x ColumnComp, angle.rad AngleComp, real ScoreComp, integer ModelComp, integer ModelMatch, string MarkOrientation, out point.y RowCompInst, out point.x ColumnCompInst, out angle.rad AngleCompInst, out real ScoreCompInst )void GetFoundComponentModel( HObject* FoundComponents, const HTuple& ComponentModelID, const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, const HTuple& ModelMatch, const HTuple& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst )static void HOperatorSet.GetFoundComponentModel( out HObject foundComponents, HTuple componentModelID, HTuple modelStart, HTuple modelEnd, HTuple rowComp, HTuple columnComp, HTuple angleComp, HTuple scoreComp, HTuple modelComp, HTuple modelMatch, HTuple markOrientation, out HTuple rowCompInst, out HTuple columnCompInst, out HTuple angleCompInst, out HTuple scoreCompInst )def get_found_component_model( component_model_id: HHandle, model_start: MaybeSequence[int], model_end: MaybeSequence[int], row_comp: MaybeSequence[float], column_comp: MaybeSequence[float], angle_comp: MaybeSequence[float], score_comp: MaybeSequence[float], model_comp: MaybeSequence[int], model_match: int, mark_orientation: str ) -> Tuple[HObject, Sequence[float], Sequence[float], Sequence[float], Sequence[float]]
def get_found_component_model_s( component_model_id: HHandle, model_start: MaybeSequence[int], model_end: MaybeSequence[int], row_comp: MaybeSequence[float], column_comp: MaybeSequence[float], angle_comp: MaybeSequence[float], score_comp: MaybeSequence[float], model_comp: MaybeSequence[int], model_match: int, mark_orientation: str ) -> Tuple[HObject, float, float, float, float]Herror T_get_found_component_model( Hobject* FoundComponents, const Htuple ComponentModelID, const Htuple ModelStart, const Htuple ModelEnd, const Htuple RowComp, const Htuple ColumnComp, const Htuple AngleComp, const Htuple ScoreComp, const Htuple ModelComp, const Htuple ModelMatch, const Htuple MarkOrientation, Htuple* RowCompInst, Htuple* ColumnCompInst, Htuple* AngleCompInst, Htuple* ScoreCompInst )
HRegion HComponentModel::GetFoundComponentModel( const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, Hlong ModelMatch, const HString& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst ) const
HRegion HComponentModel::GetFoundComponentModel( Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const HString& MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst ) const
HRegion HComponentModel::GetFoundComponentModel( Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const char* MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst ) const
HRegion HComponentModel::GetFoundComponentModel( Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const wchar_t* MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst ) const (Windows only)
static HRegion HImage::GetFoundComponentModel( const HComponentModel& ComponentModelID, const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, Hlong ModelMatch, const HString& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst )
static HRegion HImage::GetFoundComponentModel( const HComponentModel& ComponentModelID, Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const HString& MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst )
static HRegion HImage::GetFoundComponentModel( const HComponentModel& ComponentModelID, Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const char* MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst )
static HRegion HImage::GetFoundComponentModel( const HComponentModel& ComponentModelID, Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const wchar_t* MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst ) (Windows only)
HRegion HComponentModel.GetFoundComponentModel( HTuple modelStart, HTuple modelEnd, HTuple rowComp, HTuple columnComp, HTuple angleComp, HTuple scoreComp, HTuple modelComp, int modelMatch, string markOrientation, out HTuple rowCompInst, out HTuple columnCompInst, out HTuple angleCompInst, out HTuple scoreCompInst )
HRegion HComponentModel.GetFoundComponentModel( int modelStart, int modelEnd, double rowComp, double columnComp, double angleComp, double scoreComp, int modelComp, int modelMatch, string markOrientation, out double rowCompInst, out double columnCompInst, out double angleCompInst, out double scoreCompInst )
static HRegion HImage.GetFoundComponentModel( HComponentModel componentModelID, HTuple modelStart, HTuple modelEnd, HTuple rowComp, HTuple columnComp, HTuple angleComp, HTuple scoreComp, HTuple modelComp, int modelMatch, string markOrientation, out HTuple rowCompInst, out HTuple columnCompInst, out HTuple angleCompInst, out HTuple scoreCompInst )
static HRegion HImage.GetFoundComponentModel( HComponentModel componentModelID, int modelStart, int modelEnd, double rowComp, double columnComp, double angleComp, double scoreComp, int modelComp, int modelMatch, string markOrientation, out double rowCompInst, out double columnCompInst, out double angleCompInst, out double scoreCompInst )
説明
get_found_component_modelGetFoundComponentModel は、FoundComponentsfoundComponentsfound_components に
境界領域の形式で、部品モデル ComponentModelIDcomponentModelIDcomponent_model_id の中の検出
された部品を返します。同様に数値としても返されます。
オペレーター get_found_component_modelGetFoundComponentModel は、
find_component_modelFindComponentModel によって得られたマッチングの結果を視
覚的に確認する際に、特に有用です。
返された部品の姿勢は、find_component_modelFindComponentModel によって返され
た探索画像中の部品の姿勢と一致します。つまり、パラメーター
ModelStartmodelStartmodel_start、ModelEndmodelEndmodel_end、RowComprowComprow_comp、
ColumnCompcolumnCompcolumn_comp、AngleCompangleCompangle_comp、ScoreCompscoreCompscore_comp、およ
び ModelCompmodelCompmodel_comp は find_component_modelFindComponentModel によって返さ
れるので、get_found_component_modelGetFoundComponentModel に渡す必要があります。
ModelMatchmodelMatchmodel_match には、見つかった部品モデルのインデックスが渡さ
れます。
したがって、ModelMatchmodelMatchmodel_matchは 0 から m-1 の範囲内に存在
することになります。m は、ModelStartmodelStartmodel_start と
ModelEndmodelEndmodel_end の要素の数で、見つかった部品数と一致します。例え
ば、もし最も良いマッチングを返したい場合、ModelMatchmodelMatchmodel_match
は 00 に設定してください。
回転対称な部品を扱う際に、見つかった部品の現在の方向を求めることが
必要となる場合があります。これは MarkOrientationmarkOrientationmark_orientation を
'true'"true" に設定することで実現できます。この場合、各部品の輪郭領域
は、参照方向に位置するその参照点において矢印で表現されます。
部品の参照方向は、モデル画像における部品の方向(
train_model_componentsTrainModelComponents または
create_component_modelCreateComponentModel を参照してください)を元にしてお
り、参照点から始まり、水平方向右向きの矢印によって表現さ
れます。
見つかった各モデルのスコアはもちろん、姿勢のパラメーターも追加的に
数値で RowCompInstrowCompInstrow_comp_inst、ColumnCompInstcolumnCompInstcolumn_comp_inst、
AngleCompInstangleCompInstangle_comp_inst、および ScoreCompInstscoreCompInstscore_comp_inst に返されま
す。この 4 つの tuple は、常に長さ n になります。n
は、部品モデル ComponentModelIDcomponentModelIDcomponent_model_id の部品の数になります。
もし部品が探索で見つからなかった場合、空の領域が
FoundComponentsfoundComponentsfound_components の対応する要素に渡され、対応する
RowCompInstrowCompInstrow_comp_inst、ColumnCompInstcolumnCompInstcolumn_comp_inst、
AngleCompInstangleCompInstangle_comp_inst、および ScoreCompInstscoreCompInstscore_comp_inst の要素の値
が 00 に設定されます。
実行情報
実行情報
パラメーター
FoundComponentsfoundComponentsfound_components (output_object) region-array → objectHObjectHRegionHObjectHobject *
選択された部品モデルで見つかった部品
ComponentModelIDcomponentModelIDcomponent_model_id (input_control) component_model → (handle)HTuple (HHandle)HComponentModel, HTuple (IntPtr)HHandleHtuple (handle)
部品モデルのハンドル
ModelStartmodelStartmodel_start (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)
見つかった部品モデルのインスタンスの開始インデック ス
ModelEndmodelEndmodel_end (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)
部品の適合を記述した tuple での見つかった各部品モデ
ルの最後のインデックス
RowComprowComprow_comp (input_control) point.y(-array) → (real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)
見つかった部品の行座標
ColumnCompcolumnCompcolumn_comp (input_control) point.x(-array) → (real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)
見つかった部品の列座標
AngleCompangleCompangle_comp (input_control) angle.rad(-array) → (real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)
見つかった部品の回転角度
ScoreCompscoreCompscore_comp (input_control) real(-array) → (real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)
見つかった部品のスコア
ModelCompmodelCompmodel_comp (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)
見つかった部品のインデックス
ModelMatchmodelMatchmodel_match (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
見つかった部品モデルを返すためのインデックス
MarkOrientationmarkOrientationmark_orientation (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
部品の方向のマーク
初期値: 'false'"false"
値のリスト: 'false', 'true'"false", "true"
RowCompInstrowCompInstrow_comp_inst (output_control) point.y(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
選択されたモデルのすべての部品の行座標
ColumnCompInstcolumnCompInstcolumn_comp_inst (output_control) point.x(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
選択されたモデルのすべての部品の列座標
AngleCompInstangleCompInstangle_comp_inst (output_control) angle.rad(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
選択されたモデルのすべての部品の回転
ScoreCompInstscoreCompInstscore_comp_inst (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
選択されたモデルのすべての部品の一致度
結果
パラメーターが有効ならば、オペレーター
get_found_component_modelGetFoundComponentModel は値 2 (H_MSG_TRUE) を返します。必要に応じ
て、例外処理が発生します。
モジュール
Matching