copy_objcopy_objCopyObjCopyObjcopy_obj (Operator)
Name
copy_objcopy_objCopyObjCopyObjcopy_obj — Kopieren von Bildobjekten in der HALCON-Datenbank.
Signatur
void CopyObj(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
static void HOperatorSet.CopyObj(HObject objects, out HObject objectsSelected, HTuple index, HTuple numObj)
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)
Beschreibung
copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj kopiert NumObjNumObjNumObjNumObjnumObjnum_obj Bildobjekte ab
Position IndexIndexIndexIndexindexindex (beginnend mit 1) aus dem Tupel von
Eingabeobjekten in ObjectsObjectsObjectsObjectsobjectsobjects. Das resultierende Tupel von
Ausgabeobjekten wird in ObjectsSelectedObjectsSelectedObjectsSelectedObjectsSelectedobjectsSelectedobjects_selected abgelegt. Wird
für NumObjNumObjNumObjNumObjnumObjnum_obj der Wert -1 verwendet, dann werden alle
Objekte ab IndexIndexIndexIndexindexindex kopiert. Beim Kopieren werden die
Region und die Bilder nicht dupliziert. Es werden neue Objekte
angelegt, die Verweise auf die Regionen und Bilder enthalten. Die
Anzahl von Objekten in einem Tupel kann mit count_objcount_objCountObjCountObjCountObjcount_obj
abgefragt werden.
Die in HALCON verfügbaren ikonischen Objekte werden bei der Einleitung
zu Kapitel Objekt vorgestellt.
Ausführungsinformationen
- Unterstützt Objekte auf Compute Devices.
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Wird ohne Parallelisierung verarbeitet.
Parameter
ObjectsObjectsObjectsObjectsobjectsobjects (input_object) object(-array) → objectHObjectHObjectHObjectHobject
Objekte, die kopiert werden sollen.
ObjectsSelectedObjectsSelectedObjectsSelectedObjectsSelectedobjectsSelectedobjects_selected (output_object) object(-array) → objectHObjectHObjectHObjectHobject *
Kopierte Objekte.
IndexIndexIndexIndexindexindex (input_control) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Ab dieser Position in dem Tupel Object werden
Bildobjekte kopiert.
Defaultwert: 1
Wertevorschläge: 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000
Typischer Wertebereich: 1
≤
Index
Index
Index
Index
index
index
Restriktion: Index <= number(Objects)
NumObjNumObjNumObjNumObjnumObjnum_obj (input_control) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Anzahl der zu kopierenden Bildobjekte oder -1.
Defaultwert: 1
Wertevorschläge: -1, 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000
Typischer Wertebereich: -1
≤
NumObj
NumObj
NumObj
NumObj
numObj
num_obj
Restriktion: NumObj + Index - 1 <= number(Objects) && NumObj != 0
Beispiel (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)
Beispiel (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);
}
Beispiel (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)
Beispiel (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)
Beispiel (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)
Komplexität
Laufzeitkomplexität: O(|ObjectsObjectsObjectsObjectsobjectsobjects| + NumObjNumObjNumObjNumObjnumObjnum_obj);
Speicherkomplexität der Ausgabedaten: O(NumObjNumObjNumObjNumObjnumObjnum_obj)
Ergebnis
Sind die Surrogate korrekt, d.h. alle Objekte in der
HALCON-Datenbank vorhanden und die Parameter korrekt, dann liefert
copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj den Wert 2 (H_MSG_TRUE). Das Verhalten bei leerer
Eingabe (keine Eingabeobjekte vorhanden) lässt sich mittels
set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) festlegen.
Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.
Vorgänger
count_objcount_objCountObjCountObjCountObjcount_obj
Alternativen
select_objselect_objSelectObjSelectObjSelectObjselect_obj
Siehe auch
count_objcount_objCountObjCountObjCountObjcount_obj,
concat_objconcat_objConcatObjConcatObjConcatObjconcat_obj,
obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToIntegerobj_to_integer,
copy_imagecopy_imageCopyImageCopyImageCopyImagecopy_image
Modul
Foundation