HALCON Reference Manual 10.0.2
Table of Contents / Object / Manipulation ClassesClassesClasses | | | Operators

clear_objclear_objclear_objClearObjClearObj (Operator)

Name

clear_objclear_objclear_objClearObjClearObj — Delete an iconic object from the HALCON database.

Signature

clear_obj(Objects : : : )

Herror clear_obj(const Hobject Objects)

Herror T_clear_obj(const Hobject Objects)

Herror clear_obj(Hobject Objects)

void HOperatorSetX.ClearObj([in] IHUntypedObjectX* Objects)

static void HOperatorSet.ClearObj(HObject objects)

Description

clear_objclear_objclear_objClearObjClearObj deletes iconic objects, which are no longer needed, from the HALCON database. It should be noted that clear_objclear_objclear_objClearObjClearObj 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_objclear_objclear_objClearObjClearObj 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_dbreset_obj_dbreset_obj_dbResetObjDbResetObjDb can be used to reset the system and clear all remaining iconic objects.

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.

Parallelization

Parameters

ObjectsObjectsObjectsObjectsobjects (input_object)  object(-array) objectHObjectHObjectHObjectXHobject

Objects to be deleted.

Result

clear_objclear_objclear_objClearObjClearObj 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 set_check(::'~clear':)set_check("~clear")set_check("~clear")SetCheck("~clear")SetCheck("~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>:)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Alternatives

reset_obj_dbreset_obj_dbreset_obj_dbResetObjDbResetObjDb

See also

set_checkset_checkset_checkSetCheckSetCheck

Module

Foundation


Table of Contents / Object / Manipulation ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH