count_objcount_objCountObjCountObjcount_obj计数对象(算子)

名称

count_objcount_objCountObjCountObjcount_obj — 元组中的对象数。

签名

count_obj(Objects : : : Number)

Herror count_obj(const Hobject Objects, Hlong* Number)

Herror T_count_obj(const Hobject Objects, Htuple* Number)

void CountObj(const HObject& Objects, HTuple* Number)

Hlong HObject::CountObj() const

static void HOperatorSet.CountObj(HObject objects, out HTuple number)

int HObject.CountObj()

def count_obj(objects: HObject) -> int

描述

算子 count_objcount_objCountObjCountObjCountObjcount_obj 用于确定对象参数 ObjectsObjectsObjectsObjectsobjectsobjects 所包含的对象数量。在此需注意,对象与连通分量(参见 connectionconnectionConnectionConnectionConnectionconnection)并非同一概念。例如,由三个未连接部分组成的区域,其对象数量为 1。

有关 HALCON 中可用图标对象的简要说明,请参阅 对象 一章的引言部分。

执行信息

参数

ObjectsObjectsObjectsObjectsobjectsobjects (输入对象)  object-array objectHObjectHObjectHObjectHobject

待检查的对象。

NumberNumberNumberNumbernumbernumber (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

元组 ObjectsObjectsObjectsObjectsobjectsobjects 中的对象数量。

复杂度

运行时间复杂度: O(|ObjectsObjectsObjectsObjectsobjectsobjects|).

结果

count_objcount_objCountObjCountObjCountObjcount_obj 返回值 2 (H_MSG_TRUE)。

另见

copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj, obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToIntegerobj_to_integer, connectionconnectionConnectionConnectionConnectionconnection, set_systemset_systemSetSystemSetSystemSetSystemset_system

模块

基础