obj_to_integerobj_to_integerObjToIntegerObjToInteger (Operator)
Name
obj_to_integerobj_to_integerObjToIntegerObjToInteger
— Convert an iconic object into an “integer number.”
Signature
Description
obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToInteger
stores NumberNumberNumberNumbernumber
, starting at index
IndexIndexIndexIndexindex
, of the database keys of the input object
ObjectsObjectsObjectsObjectsobjects
as integer numbers in the output parameter
SurrogateTupleSurrogateTupleSurrogateTupleSurrogateTuplesurrogateTuple
. If -1 is passed for NumberNumberNumberNumbernumber
all
objects beginning with IndexIndexIndexIndexindex
are copied. This facilitates
a direct access to an arbitrary element of ObjectsObjectsObjectsObjectsobjects
. In
conjunction with count_objcount_objCountObjCountObjCountObj
(returns the number of objects in
ObjectsObjectsObjectsObjectsobjects
) the elements of ObjectsObjectsObjectsObjectsobjects
can be processed
successively. The objects are not duplicated by
obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToInteger
and thus must not be cleared by
clear_objclear_objClearObjClearObjClearObj
.
For a short description of the iconic objects that are available in HALCON
see the introduction of chapter Object.
Attention
The objects' data is not duplicated.
Execution Information
- Supports objects on compute devices.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
ObjectsObjectsObjectsObjectsobjects
(input_object) object(-array) →
objectHObjectHObjectHobject
Objects for which the surrogates are to be returned.
IndexIndexIndexIndexindex
(input_control) integer →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Starting index of the surrogates to be returned.
Default value: 1
Typical range of values: 1
≤
Index
Index
Index
Index
index
NumberNumberNumberNumbernumber
(input_control) integer →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of surrogates to be returned.
Default value: -1
Restriction: Number == -1 || Number + Index <= number(Objects)
SurrogateTupleSurrogateTupleSurrogateTupleSurrogateTuplesurrogateTuple
(output_control) pointer(-array) →
HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)
Tuple containing the surrogates.
Example (HDevelop)
* Access the i-th element:
obj_to_integer(Objects,i,1,Surrogat)
Example (C)
/* Access the i-th element: */
Hlong i,Surrogate;
obj_to_integer(Objects,i,1,&Surrogat);
Example (HDevelop)
* Access the i-th element:
obj_to_integer(Objects,i,1,Surrogat)
Example (HDevelop)
* Access the i-th element:
obj_to_integer(Objects,i,1,Surrogat)
Example (HDevelop)
* Access the i-th element:
obj_to_integer(Objects,i,1,Surrogat)
Complexity
Runtime complexity: O(|ObjectsObjectsObjectsObjectsobjects
| + NumberNumberNumberNumbernumber
)
Result
obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToInteger
returns 2 (H_MSG_TRUE) if 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>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)
.
If necessary, an exception is raised.
Alternatives
copy_objcopy_objCopyObjCopyObjCopyObj
,
select_objselect_objSelectObjSelectObjSelectObj
,
copy_imagecopy_imageCopyImageCopyImageCopyImage
,
gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProto
See also
integer_to_objinteger_to_objIntegerToObjIntegerToObjIntegerToObj
,
count_objcount_objCountObjCountObjCountObj
Module
Foundation