第一种:
- ImagePath := []
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- for Index := to by
- dev_close_window ()
- read_image (Image, ImagePath[Index])
- get_image_size (Image, Width, Height)
- dev_open_window ( , , Width, Height, 'black', WindowHandle)
- dev_display (Image)
- endfor
第二种:
- for i := 1 to 5 by 1
- dev_close_window ()
- read_image (Image, 'D:/halcon_test/读取多张图片的方式/'+i+'.jpg')
- get_image_size (Image, Width, Height)
- dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
- dev_display (Image)
- endfor
第三种:
- for I := to by
- dev_close_window ()
- *I$表示引用I的值,而 '1d'的 'd'则表示采用十进制数表示,取一位数,如 、 、 此类,
- *故 '3d'则表示为取三位十进制数,如 、 、 诸如此类
- read_image (Image, 'D:/halcon_test/读取多张图片的方式/'+I$' d ')
- get_image_size (Image, Width, Height)
- dev_open_window (0, 0, Width, Height, 'black ', WindowHandle)
- dev_display (Image)
- endfor
第四种:
第四种方法 (读取一个文件夹下的所有图片)
【助手】-->【打开新的image acquisition 】-->【图像助手】-->【选择路径】-->【代码生成】-->【插入代码】
第一种:
- ImagePath := []
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- ImagePath[ ] := 'D:/halcon_test/读取多张图片的方式/ .jpg'
- for Index := to by
- dev_close_window ()
- read_image (Image, ImagePath[Index])
- get_image_size (Image, Width, Height)
- dev_open_window ( , , Width, Height, 'black', WindowHandle)
- dev_display (Image)
- endfor
第二种:
- for i := 1 to 5 by 1
- dev_close_window ()
- read_image (Image, 'D:/halcon_test/读取多张图片的方式/'+i+'.jpg')
- get_image_size (Image, Width, Height)
- dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
- dev_display (Image)
- endfor
第三种:
- for I := to by
- dev_close_window ()
- *I$表示引用I的值,而 '1d'的 'd'则表示采用十进制数表示,取一位数,如 、 、 此类,
- *故 '3d'则表示为取三位十进制数,如 、 、 诸如此类
- read_image (Image, 'D:/halcon_test/读取多张图片的方式/'+I$' d ')
- get_image_size (Image, Width, Height)
- dev_open_window (0, 0, Width, Height, 'black ', WindowHandle)
- dev_display (Image)
- endfor
第四种:
第四种方法 (读取一个文件夹下的所有图片)
【助手】-->【打开新的image acquisition 】-->【图像助手】-->【选择路径】-->【代码生成】-->【插入代码】