本地图片
-
读取本地图片常使用read_image。
-
读取halcon自带图片,不需要添加路径和后缀
这些图片在halcon例程文件夹的images文件夹内
比如下面读取\examples\images下的earth.png
read_image(Image,'earth')
halcon安装的时候,其实是把例程文件夹的路径加入了系统环境变量,HALCONIMAGES -
读取自己的图片需要使用路径
可以使用绝对路径,也可以使用相对路径
比如读取上级目录下的image文件夹下的earth.png
read_image (Image, '../image/earth')
如果没有同名的文件,可以省略后缀 -
读取文件夹下所有图片
list_files ('../image', ['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 imgIndex := 0 to |ImageFiles| - 1 by 1
read_image (Image, ImageFiles[imgIndex])
endfor
mindvision相机读取
- 安装MindVision相机官方驱动,确保驱动能正常连接相机
- 打开halcon助手

最低0.47元/天 解锁文章
1087

被折叠的 条评论
为什么被折叠?



