第一種:
- 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 】-->【圖像助手】-->【選擇路徑】-->【代碼生成】-->【插入代碼】