select_obj — 从对象元组中选择对象。
select_obj(Objects : ObjectSelected : Index : )
select_obj copies the iconic objects with the indices given
by Index (starting with 1) from the iconic input object
tuple Objects to the output object ObjectSelected.
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_obj。
For a short description of the iconic objects that are available in HALCON see the introduction of chapter 对象。
Objects (输入对象) object(-array) → object
Input objects.
ObjectSelected (输出对象) object(-array) → object
Selected objects.
Index (输入控制) integer(-array) → (integer)
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
/* 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(|Objects|)
select_obj 算子返回 2 ( H_MSG_TRUE ) 表示所有对象均存在于 HALCON 数据库中且所有参数均正确。如果输入为空则可设置行为通过 set_system(::'no_object_result',<Result>:)。如有必要,则抛出异常。
count_obj,
concat_obj,
obj_to_integer
基础