select_objselect_objSelectObjSelectObjselect_obj (算子)

名称

select_objselect_objSelectObjSelectObjselect_obj — 从对象元组中选择对象。

签名

select_obj(Objects : ObjectSelected : Index : )

Herror select_obj(const Hobject Objects, Hobject* ObjectSelected, const Hlong Index)

Herror T_select_obj(const Hobject Objects, Hobject* ObjectSelected, const Htuple Index)

void SelectObj(const HObject& Objects, HObject* ObjectSelected, const HTuple& Index)

HObject HObject::SelectObj(const HTuple& Index) const

HObject HObject::SelectObj(Hlong Index) const

HImage HImage::SelectObj(const HTuple& Index) const

HImage HImage::SelectObj(Hlong Index) const

HRegion HRegion::SelectObj(const HTuple& Index) const

HRegion HRegion::SelectObj(Hlong Index) const

HXLD HXLD::SelectObj(const HTuple& Index) const

HXLD HXLD::SelectObj(Hlong Index) const

HXLDCont HXLDCont::SelectObj(const HTuple& Index) const

HXLDCont HXLDCont::SelectObj(Hlong Index) const

HXLDPoly HXLDPoly::SelectObj(const HTuple& Index) const

HXLDPoly HXLDPoly::SelectObj(Hlong Index) const

HXLDPara HXLDPara::SelectObj(const HTuple& Index) const

HXLDPara HXLDPara::SelectObj(Hlong Index) const

HXLDModPara HXLDModPara::SelectObj(const HTuple& Index) const

HXLDModPara HXLDModPara::SelectObj(Hlong Index) const

HXLDExtPara HXLDExtPara::SelectObj(const HTuple& Index) const

HXLDExtPara HXLDExtPara::SelectObj(Hlong Index) const

static void HOperatorSet.SelectObj(HObject objects, out HObject objectSelected, HTuple index)

HObject HObject.SelectObj(HTuple index)

HObject HObject.SelectObj(int index)

HImage HImage.SelectObj(HTuple index)

HImage HImage.SelectObj(int index)

HRegion HRegion.SelectObj(HTuple index)

HRegion HRegion.SelectObj(int index)

HXLD HXLD.SelectObj(HTuple index)

HXLD HXLD.SelectObj(int index)

HXLDCont HXLDCont.SelectObj(HTuple index)

HXLDCont HXLDCont.SelectObj(int index)

HXLDPoly HXLDPoly.SelectObj(HTuple index)

HXLDPoly HXLDPoly.SelectObj(int index)

HXLDPara HXLDPara.SelectObj(HTuple index)

HXLDPara HXLDPara.SelectObj(int index)

HXLDModPara HXLDModPara.SelectObj(HTuple index)

HXLDModPara HXLDModPara.SelectObj(int index)

HXLDExtPara HXLDExtPara.SelectObj(HTuple index)

HXLDExtPara HXLDExtPara.SelectObj(int index)

def select_obj(objects: HObject, index: MaybeSequence[int]) -> HObject

描述

select_objselect_objSelectObjSelectObjSelectObjselect_obj copies the iconic objects with the indices given by IndexIndexIndexIndexindexindex (starting with 1) from the iconic input object tuple ObjectsObjectsObjectsObjectsobjectsobjects to the output object ObjectSelectedObjectSelectedObjectSelectedObjectSelectedobjectSelectedobject_selected. No new storage is allocated for the regions and images. Instead, new objects containing references to the existing objects are created. The number of objects in an object tuple can be queried with the operator count_objcount_objCountObjCountObjCountObjcount_obj

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

执行信息

参数

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

Input objects.

ObjectSelectedObjectSelectedObjectSelectedObjectSelectedobjectSelectedobject_selected (输出对象)  object(-array) objectHObjectHObjectHObjectHobject *

Selected objects.

IndexIndexIndexIndexindexindex (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices of the objects to be selected.

默认值: 1

建议值: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 50, 100, 200, 500, 1000, 2000, 5000

限制: Index >= 1

示例(C)

/* Access to all Regions */

count_obj(Regions,&Num);
for (i=1; i<=Num; i++)
{
  select_obj(Regions,&Single,i);
  T_get_region_polygon(Single,5.0,&Row,&Column);
  T_disp_polygon(WindowHandleTuple,Row,Column);
  destroy_tuple(Row);
  destroy_tuple(Column);
}

复杂度

Runtime complexity: O(|ObjectsObjectsObjectsObjectsobjectsobjects|)

结果

select_objselect_objSelectObjSelectObjSelectObjselect_obj 算子返回 2 ( H_MSG_TRUE ) 表示所有对象均存在于 HALCON 数据库中且所有参数均正确。如果输入为空则可设置行为通过 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>)。如有必要,则抛出异常。

可能的前趋

count_objcount_objCountObjCountObjCountObjcount_obj

替代

copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj

另见

count_objcount_objCountObjCountObjCountObjcount_obj, concat_objconcat_objConcatObjConcatObjConcatObjconcat_obj, obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToIntegerobj_to_integer

模块

基础