Halcon基础知识(四)循环读取文件的实现以及数字与字符的转换

在循环读取文件的位置时,常用到数字与字符的转换。

  • 数字与字符的转换
将字符转换为数字
tuple_number(StringImageIndex,IntImageIndex)`
  • 1
  • 2
将数字转换为字符
tuple_string (IntImageIndex, '0', StringImageIndex)
  • 1
  • 2
  • 循环读取图片 
      这其中就利用了tuple_string将数字转化为字符,从而实现读取地址的改变。
Count:= 1
for Index := 1 to 5 by 1
    tuple_string (Index, '0', StringIndex)
    filename := 'F:\\SZWX912\\TestImage\\'+StringIndex+'.bmp'
    read_image (Image, filename)
endfor

猜你喜欢

转载自blog.csdn.net/leo_888/article/details/80271352
今日推荐