Halcon中循环读取文件的实现以及数字与字符的转换

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

  • 数字与字符的转换
将字符转换为数字
tuple_number(StringImageIndex,IntImageIndex)`
  • 1
  • 2
  • 1
  • 2
将数字转换为字符
tuple_string (IntImageIndex, '0', StringImageIndex)
  • 1
  • 2
  • 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
 
 
原文地址:https://www.cnblogs.com/qqhfeng/p/7259518.html