clear_obj ( Objects : : : )

Delete an iconic object from the HALCON database.

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


Attention

Regarding the use of local variables: Because only local variables are deleted on exit of a subroutine, while the HALCON database is not updated, it is necessary to clear local objects before exiting the subroutine.


Parameters

Objects (input_object)
object(-array) -> object
Objects to be deleted.


Result

clear_obj 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':) 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.


Parallelization Information

clear_obj is reentrant and processed without parallelization.


Possible Predecessors

test_obj_def


Alternatives

reset_obj_db


See also

test_obj_def, set_check


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH