copy_obj ( Objects : ObjectsSelected : Index, NumObj : )

Copy an iconic object in the HALCON database.

copy_obj copies NumObj iconic objects beginning with index Index (starting with 1) from the iconic input object tuple Objects to the output object ObjectsSelected. If -1 is passed for NumObj all objects beginning with Index 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_obj.


Parameters

Objects (input_object)
object(-array) -> object
Objects to be copied.

ObjectsSelected (output_object)
object(-array) -> object
Copied objects.

Index (input_control)
integer -> integer
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
Restriction: Index <= number(Objects)

NumObj (input_control)
integer -> integer
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
Restriction: ((NumObj + Index) <= number(Objects)) && (NumObj != 0)


Example
/* Access all regions */

count_obj(Regions,Num) 
for(1,Num,i) 
  copy_obj(Regions,Single,i,1) 
  get_region_polygon(Single,5.0,Line,Column) 
  disp_polygon(WindowHandle,Line,Column) 
  clear_obj(Single) 
loop().

Complexity

Runtime complexity: O(|Objects| + NumObj);

Memory complexity of the result object: O(NumObj)


Result

copy_obj 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>:). If necessary, an exception is raised.


Parallelization Information

copy_obj is reentrant and processed without parallelization.


Possible Predecessors

count_obj


Alternatives

select_obj


See also

count_obj, concat_obj, obj_to_integer, copy_image


Module

Basic operators



Copyright © 1996-2005 MVTec Software GmbH