Skip to content

copy_objCopyObjCopyObjcopy_objcopy_obj🔗

説明🔗

copy_objCopyObjCopyObjcopy_objcopy_obj — HALCON データベース内でアイコンオブジェクトをコピーする。

書式🔗

copy_obj( object Objects, out object ObjectsSelected, integer Index, integer NumObj )void CopyObj( const HObject& Objects, HObject* ObjectsSelected, const HTuple& Index, const HTuple& NumObj )static void HOperatorSet.CopyObj( HObject objects, out HObject objectsSelected, HTuple index, HTuple numObj )def copy_obj( objects: HObject, index: int, num_obj: int ) -> HObject

Herror copy_obj( const Hobject Objects, Hobject* ObjectsSelected, const Hlong Index, const Hlong NumObj )

Herror T_copy_obj( const Hobject Objects, Hobject* ObjectsSelected, const Htuple Index, const Htuple NumObj )

HObject HObject::CopyObj( Hlong Index, Hlong NumObj ) const

HImage HImage::CopyObj( Hlong Index, Hlong NumObj ) const

HRegion HRegion::CopyObj( Hlong Index, Hlong NumObj ) const

HXLD HXLD::CopyObj( Hlong Index, Hlong NumObj ) const

HXLDCont HXLDCont::CopyObj( Hlong Index, Hlong NumObj ) const

HXLDPoly HXLDPoly::CopyObj( Hlong Index, Hlong NumObj ) const

HXLDPara HXLDPara::CopyObj( Hlong Index, Hlong NumObj ) const

HXLDModPara HXLDModPara::CopyObj( Hlong Index, Hlong NumObj ) const

HXLDExtPara HXLDExtPara::CopyObj( Hlong Index, Hlong NumObj ) const

HObject HObject.CopyObj( int index, int numObj )

HImage HImage.CopyObj( int index, int numObj )

HRegion HRegion.CopyObj( int index, int numObj )

HXLD HXLD.CopyObj( int index, int numObj )

HXLDCont HXLDCont.CopyObj( int index, int numObj )

HXLDPoly HXLDPoly.CopyObj( int index, int numObj )

HXLDPara HXLDPara.CopyObj( int index, int numObj )

HXLDModPara HXLDModPara.CopyObj( int index, int numObj )

HXLDExtPara HXLDExtPara.CopyObj( int index, int numObj )

説明🔗

copy_objCopyObj は、インデックス Indexindexindex(1 から開始)で始 まる NumObjnumObjnum_obj個 のアオブジェクトをオブジェ クト 配列Objectsobjectsobjects から出力オブジェクト ObjectsSelectedobjectsSelectedobjects_selected にコピーします。-1 が NumObjnumObjnum_obj に 渡されると、Indexindexindex 以降全てのオブジェクトがコピー されます。生成された領域と画像に対して新しいメモリは割り当てられません。その 代わり、既存のオブジェクトに対するアドレス参照を含む新しいオブジェクトが生 成されます。 オブジェクト tuple 内のオブジェクト数はオペレーター count_objCountObj を利用して問い合わせることができます。

HALCON で使用できるアイコンオブジェクトの簡単な説明はObjectの章を参照してください。

実行情報🔗

実行情報
  • 演算デバイス上のオブジェクトをサポート。

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

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

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

パラメーター🔗

Objectsobjectsobjects (input_object) object(-array) → objectHObjectHObjectHObjectHobject

コピーされる入力オブジェクト

ObjectsSelectedobjectsSelectedobjects_selected (output_object) object(-array) → objectHObjectHObjectHObjectHobject *

コピーされたオブジェクト

Indexindexindex (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

コピーされるオブジェクトの開始インデックス

初期値: 11
推奨値: 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 50001, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000
値域: 1 ≤ Index
制限: Index <= number(Objects)

NumObjnumObjnum_obj (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

コピーされるオブジェクトの数または -1

初期値: 11
推奨値: -1, 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000-1, 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000
値域: -1 ≤ NumObj
制限: (NumObj + Index - 1) <= number(Objects) && NumObj != 0

例🔗

(HDevelop)


gen_circle (Circles, [100,200,400], [200,100,400], [100,100,50])
copy_obj (Circles, CircleCopy, 2, 3)
erosion_circle (CircleCopy, CircleErosion, 15.5)
dev_set_color ('red')
dev_set_draw ('fill')
dev_display(Circles)
dev_set_color ('white')
dev_set_draw ('margin')
dev_display (CircleCopy)
dev_set_color ('green')
dev_display (CircleErosion)
(C)
/* Access all regions */

count_obj(Regions,&Num)\;
for (i=1\; i<=Num\; i++)\;
{
  copy_obj(Regions,&Single,i,1)\;
  T_get_region_polygon(Single,5.0,&Row,&Column)\;
  T_disp_polygon(WindowHandleTuple,Row,Column)\;
  destroy_tuple(Row)\;
  destroy_tuple(Column)\;
}

複雑性🔗

実行時間の複雑性: \(O(|\textrm{Objects}| + \textrm{NumObj})\);

結果オブジェクトのメモリの複雑性: \(O(\textrm{NumObj})\)

結果🔗

すべてのオブジェクトが HALCON データベース内に含まれ、すべてのパラ メーターが正しい場合、copy_objCopyObj は、値 2 (H_MSG_TRUE) を返します。入 力が空の場合、動作は set_system(::'no_object_result',<Result>:) を通じて設定で きます。 必要に応じて、例外が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

count_objCountObj

他の選択候補

select_objSelectObj

関連項目

count_objCountObj, concat_objConcatObj, obj_to_integerObjToInteger, copy_imageCopyImage

モジュール🔗

Foundation