Halcon快速入门笔记12

*元组初始化 Tuple

Test:=[]

Test:=[1,2,3,4,5,6]

Test:=gen_tuple_const(3, 123)

*元组赋值

Test[1]:=456

*元组拼接

Test:=[Test,Test]

tuple_concat (Test, Test, Concat)

*元组取模

length:=|Concat|

tuple_length (Concat, Length)

*索引取值

value:=Concat[10]

tuple_select (Concat, 10, Selected)

value2:=subset(Concat, 10)

*元组截取

array:=Concat[1:2]

tuple_select_range (Concat, 1, 2, Selected1)

*移除某个元素

test1:=remove(Concat, 1)

tuple_remove (Concat, 1, Reduced)

*获取某个元素的位置

test2:=find(Concat, 123)

tuple_find_first (Concat, 123, Index)

*异常捕获

dev_set_check (‘give_error’)

try

read_image (Image, ‘printer_chip/printer_ch=ip_01’)

catch (Exception)

 stop()

endtry

posted @ 2022-10-07 15:13  视觉人机器视觉  阅读(34)  评论(0)    收藏  举报  来源