HALCON Reference Manual 10.0.2
Table of Contents / Object / Manipulation ClassesClassesClasses | | | Operators

copy_objcopy_objcopy_objCopyObjCopyObj (Operator)

Name

copy_objcopy_objcopy_objCopyObjCopyObj — Copy an iconic object in the HALCON database.

Signature

copy_obj(Objects : ObjectsSelected : Index, NumObj : )

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)

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

void HOperatorSetX.CopyObj(
[in] IHUntypedObjectX* Objects, [out] IHUntypedObjectX*ObjectsSelected, [in] VARIANT Index, [in] VARIANT NumObj)

IHImageX* HImageX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHRegionX* HRegionX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHUntypedObjectX* HUntypedObjectX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHXLDContX* HXLDContX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHXLDPolyX* HXLDPolyX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHXLDParaX* HXLDParaX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHXLDModParaX* HXLDModParaX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

IHXLDExtParaX* HXLDExtParaX.CopyObj(
[in] Hlong Index, [in] Hlong NumObj)

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)

Description

copy_objcopy_objcopy_objCopyObjCopyObj copies NumObjNumObjNumObjNumObjnumObj iconic objects beginning with index IndexIndexIndexIndexindex (starting with 1) from the iconic input object tuple ObjectsObjectsObjectsObjectsobjects to the output object ObjectsSelectedObjectsSelectedObjectsSelectedObjectsSelectedobjectsSelected. If -1 is passed for NumObjNumObjNumObjNumObjnumObj all objects beginning with IndexIndexIndexIndexindex are copied. No new storage is allocated for the regions and images. Instead, new objects containing references to the existing objects are created. The number of objects in an object tuple can be queried with the operator count_objcount_objcount_objCountObjCountObj.

Parallelization

Parameters

ObjectsObjectsObjectsObjectsobjects (input_object)  object(-array) objectHObjectHObjectHObjectXHobject

Objects to be copied.

ObjectsSelectedObjectsSelectedObjectsSelectedObjectsSelectedobjectsSelected (output_object)  object(-array) objectHObjectHObjectHObjectXHobject *

Copied objects.

IndexIndexIndexIndexindex (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Starting index of the objects to be copied.

Default value: 1

Suggested values: 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000

Typical range of values: 1 ≤ Index Index Index Index index

Restriction: Index <= number(Objects)

NumObjNumObjNumObjNumObjnumObj (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of objects to be copied or -1.

Default value: 1

Suggested values: -1, 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000

Typical range of values: -1 ≤ NumObj NumObj NumObj NumObj numObj

Restriction: (((NumObj + Index) - 1) <= number(Objects)) && (NumObj != 0)

Example (HDevelop)

* Access all regions

count_obj(Regions,Num)
for i := 1 to Num by 1
  copy_obj(Regions,Single,i,1)
  get_region_polygon(Single,5.0,Line,Column)
  disp_polygon(WindowHandle,Line,Column)
  clear_obj(Single)
endfor

Example (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);
  clear_obj(Single);
}

Example (HDevelop)

* Access all regions

count_obj(Regions,Num)
for i := 1 to Num by 1
  copy_obj(Regions,Single,i,1)
  get_region_polygon(Single,5.0,Line,Column)
  disp_polygon(WindowHandle,Line,Column)
  clear_obj(Single)
endfor

Example (HDevelop)

* Access all regions

count_obj(Regions,Num)
for i := 1 to Num by 1
  copy_obj(Regions,Single,i,1)
  get_region_polygon(Single,5.0,Line,Column)
  disp_polygon(WindowHandle,Line,Column)
  clear_obj(Single)
endfor

Example (HDevelop)

* Access all regions

count_obj(Regions,Num)
for i := 1 to Num by 1
  copy_obj(Regions,Single,i,1)
  get_region_polygon(Single,5.0,Line,Column)
  disp_polygon(WindowHandle,Line,Column)
  clear_obj(Single)
endfor

Complexity

Runtime complexity: O(|ObjectsObjectsObjectsObjectsobjects| + NumObjNumObjNumObjNumObjnumObj);

Memory complexity of the result object: O(NumObjNumObjNumObjNumObjnumObj)

Result

copy_objcopy_objcopy_objCopyObjCopyObj returns 2 (H_MSG_TRUE) if all objects are contained in the HALCON database and all parameters are correct. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

count_objcount_objcount_objCountObjCountObj

Alternatives

select_objselect_objselect_objSelectObjSelectObj

See also

count_objcount_objcount_objCountObjCountObj, concat_objconcat_objconcat_objConcatObjConcatObj, obj_to_integerobj_to_integerobj_to_integerObjToIntegerObjToInteger, copy_imagecopy_imagecopy_imageCopyImageCopyImage

Module

Foundation


Table of Contents / Object / Manipulation ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH