halcon------图像读取

1、本地图片读取

① 单张读取
read_image (Image, 'C:/Users/Administrator/Desktop/1.png')

② 编号连续的图片读取(000、001、002……)

for i := 3 to 6 by 1
  read_image (Image, 'C:/Users/Administrator/Desktop/pic/' + i$'.3' + '.jpg')

endfor

另一种读取方式

list_files('地址+文件名',‘files’,存储名)
for i=0 to N by 1
      read_image(image_read,image[i])
      dev_display(image_read)
 endfor
 //


③ 读取文件夹(及子文件夹)下全部图片

 
list_files ('D:/photo', ['files','follow_links'], ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima)$','ignore_case'], ImageFiles)
for Index := 0 to |ImageFiles| - 1 by 1
  read_image (Image, ImageFiles[Index])
endfor

 

 算子list_files中可以有多个参数,例如:

'directories':读取文件夹
'recursive':递归,读取子文件夹里面的文件
'max_depth 3':支持3级文件目录深度的文件检索
'max_files 1000':最大文件数目不超过1000个

……
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值