Operator Reference

obj_to_integerobj_to_integerObjToIntegerObjToIntegerobj_to_integer (Operator)

obj_to_integerobj_to_integerObjToIntegerObjToIntegerobj_to_integer — Convert an iconic object into an “integer number.”

Signature

obj_to_integer(Objects : : Index, Number : SurrogateTuple)

Herror obj_to_integer(const Hobject Objects, const Hlong Index, const Hlong Number, Hlong* SurrogateTuple)

Herror T_obj_to_integer(const Hobject Objects, const Htuple Index, const Htuple Number, Htuple* SurrogateTuple)

void ObjToInteger(const HObject& Objects, const HTuple& Index, const HTuple& Number, HTuple* SurrogateTuple)

HTuple HObject::ObjToInteger(Hlong Index, Hlong Number) const

static void HOperatorSet.ObjToInteger(HObject objects, HTuple index, HTuple number, out HTuple surrogateTuple)

HTuple HObject.ObjToInteger(int index, int number)

def obj_to_integer(objects: HObject, index: int, number: int) -> Sequence[int]

def obj_to_integer_s(objects: HObject, index: int, number: int) -> int

Description

obj_to_integerobj_to_integerObjToIntegerObjToIntegerobj_to_integer stores NumberNumberNumbernumbernumber, starting at index IndexIndexIndexindexindex, of the database keys of the input object ObjectsObjectsObjectsobjectsobjects as integer numbers in the output parameter SurrogateTupleSurrogateTupleSurrogateTuplesurrogateTuplesurrogate_tuple. 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_objCountObjCountObjcount_obj (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_integerObjToIntegerObjToIntegerobj_to_integer and thus must not be cleared by clear_objclear_objClearObjClearObjclear_obj.

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) objectHObjectHObjectHObjectHobject

Objects for which the surrogates are to be returned.

IndexIndexIndexindexindex (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Starting index of the surrogates to be returned.

Default: 1

Value range: 1 ≤ Index Index Index index index

NumberNumberNumbernumbernumber (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of surrogates to be returned.

Default: -1

Restriction: Number == -1 || Number + Index <= number(Objects)

SurrogateTupleSurrogateTupleSurrogateTuplesurrogateTuplesurrogate_tuple (output_control)  pointer(-array) HTupleSequence[int]HTupleHtuple (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)

Complexity

Runtime complexity: O(|ObjectsObjectsObjectsobjectsobjects| + NumberNumberNumbernumbernumber)

Result

obj_to_integerobj_to_integerObjToIntegerObjToIntegerobj_to_integer 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>)set_system("no_object_result",<Result>). If necessary, an exception is raised.

Alternatives

copy_objcopy_objCopyObjCopyObjcopy_obj, select_objselect_objSelectObjSelectObjselect_obj, copy_imagecopy_imageCopyImageCopyImagecopy_image, gen_image_protogen_image_protoGenImageProtoGenImageProtogen_image_proto

See also

integer_to_objinteger_to_objIntegerToObjIntegerToObjinteger_to_obj, count_objcount_objCountObjCountObjcount_obj

Module

Foundation