Skip to content

clear_objClearObjClearObjclear_objclear_objπŸ”—

Short descriptionπŸ”—

clear_objClearObjClearObjclear_objclear_obj β€” Delete an iconic object from the HALCON database.

SignatureπŸ”—

clear_obj( object Objects )void ClearObj( const HObject& Objects )static void HOperatorSet.ClearObj( HObject objects )def clear_obj( objects: HObject ) -> None

Herror clear_obj( const Hobject Objects )

Herror T_clear_obj( const Hobject Objects )

DescriptionπŸ”—

clear_objClearObj deletes iconic objects, which are no longer needed, from the HALCON database. It should be noted that clear_objClearObj is the only way to delete objects from the database, and hence to reclaim their memory, in HALCON/C. In all other HALCON language interfaces, clear_objClearObj must not be used because objects are destroyed automatically through appropriate destructors.

Images and regions are normally used by several iconic objects at the same time (uses less memory!). This has the consequence that a region or an image is only deleted if all objects using it have been deleted.

The operator reset_obj_dbResetObjDb can be used to reset the system and clear all remaining iconic objects.

For a short description of the iconic objects that are available in HALCON see the introduction of chapter Object.

AttentionπŸ”—

Regarding the use of local variables in HALCON/C: When exiting a subroutine, the local variables are deleted, but the HALCON database is not updated. To update the database and thus free the memory, you must explicitly clear the local objects from the database before exiting the subroutine.

Execution informationπŸ”—

Execution information
  • 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 to be deleted.

ResultπŸ”—

clear_objClearObj returns 2 (H_MSG_TRUE) if all objects are contained in the HALCON database. If not all objects are valid (e.g., already cleared), an exception is raised, which also clears all valid objects. The operator texttt{set_check(β€˜~clear’)} can be used to suppress the raising of this exception. 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

reset_obj_dbResetObjDb

See also

set_checkSetCheck

ModuleπŸ”—