Skip to content

obj_to_integerObjToIntegerObjToIntegerobj_to_integerobj_to_integerπŸ”—

Short descriptionπŸ”—

obj_to_integerObjToIntegerObjToIntegerobj_to_integerobj_to_integer β€” Convert an iconic object into an β€œinteger number.”

SignatureπŸ”—

obj_to_integer( object Objects, integer Index, integer Number, out pointer SurrogateTuple )void ObjToInteger( const HObject& Objects, const HTuple& Index, const HTuple& Number, HTuple* SurrogateTuple )static void HOperatorSet.ObjToInteger( HObject objects, HTuple index, HTuple number, out HTuple surrogateTuple )def obj_to_integer( objects: HObject, index: int, number: int ) -> Sequence[int]

def obj_to_integer_s( objects: HObject, index: int, number: int ) -> intHerror 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 )

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

HTuple HObject.ObjToInteger( int index, int number )

DescriptionπŸ”—

obj_to_integerObjToInteger stores Numbernumbernumber, starting at index Indexindexindex, of the database keys of the input object Objectsobjectsobjects as integer numbers in the output parameter SurrogateTuplesurrogateTuplesurrogate_tuple. If -1 is passed for Numbernumbernumber all objects beginning with Indexindexindex are copied. This facilitates a direct access to an arbitrary element of Objectsobjectsobjects. In conjunction with count_objCountObj (returns the number of objects in Objectsobjectsobjects) the elements of Objectsobjectsobjects can be processed successively. The objects are not duplicated by obj_to_integerObjToInteger and thus must not be cleared by clear_objClearObj.

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πŸ”—

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πŸ”—

Objectsobjectsobjects (input_object) object(-array) β†’ objectHObjectHObjectHObjectHobject

Objects for which the surrogates are to be returned.

Indexindexindex (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Starting index of the surrogates to be returned.

Default: 11
Value range: 1 ≀ Index

Numbernumbernumber (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of surrogates to be returned.

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

SurrogateTuplesurrogateTuplesurrogate_tuple (output_control) pointer(-array) β†’ (integer)HTuple (Hlong)HTuple (IntPtr)Sequence[int]Htuple (Hlong)

Tuple containing the surrogates.

ExampleπŸ”—

(HDevelop)

* Access the i-th element:
obj_to_integer(Objects,i,1,Surrogat)
(C)
/* Access the i-th element: */
Hlong i,Surrogate\;
obj_to_integer(Objects,i,1,&Surrogat)\;

ComplexityπŸ”—

Runtime complexity: \(O(|\textrm{Objects}| + \textrm{Number})\)

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Alternatives

copy_objCopyObj, select_objSelectObj, copy_imageCopyImage, gen_image_protoGenImageProto

See also

integer_to_objIntegerToObj, count_objCountObj

ModuleπŸ”—

Foundation