clear_objclear_objClearObjClearObjclear_obj (算子)

名称

clear_objclear_objClearObjClearObjclear_obj — 从 HALCON 数据库中删除图标对象。

签名

clear_obj(Objects : : : )

Herror clear_obj(const Hobject Objects)

Herror T_clear_obj(const Hobject Objects)

void ClearObj(const HObject& Objects)

static void HOperatorSet.ClearObj(HObject objects)

def clear_obj(objects: HObject) -> None

描述

clear_objclear_objClearObjClearObjClearObjclear_obj deletes iconic objects, which are no longer needed, from the HALCON database. It should be noted that clear_objclear_objClearObjClearObjClearObjclear_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_objclear_objClearObjClearObjClearObjclear_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_dbreset_obj_dbResetObjDbResetObjDbResetObjDbreset_obj_db 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 对象

注意

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.

执行信息

参数

ObjectsObjectsObjectsObjectsobjectsobjects (输入对象)  object(-array) objectHObjectHObjectHObjectHobject

Objects to be deleted.

结果

clear_objclear_objClearObjClearObjClearObjclear_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':)set_check("~clear")SetCheck("~clear")SetCheck("~clear")SetCheck("~clear")set_check("~clear") can be used to suppress the raising of this exception. 如果输入为空则可设置行为通过 set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

替代

reset_obj_dbreset_obj_dbResetObjDbResetObjDbResetObjDbreset_obj_db

另见

set_checkset_checkSetCheckSetCheckSetCheckset_check

模块

基础