天天看點

Halcon讀取檔案中圖像方式

第一種:

  1. ImagePath := []
  2. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  3. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  4. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  5. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  6. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  7. for Index := to by
  8. dev_close_window ()
  9. read_image (Image, ImagePath[Index])
  10. get_image_size (Image, Width, Height)
  11. dev_open_window ( , , Width, Height, 'black', WindowHandle)
  12. dev_display (Image)
  13. endfor

第二種:

  1. for i := 1 to 5 by 1
  2. dev_close_window ()
  3. read_image (Image, 'D:/halcon_test/讀取多張圖檔的方式/'+i+'.jpg')
  4. get_image_size (Image, Width, Height)
  5. dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
  6. dev_display (Image)
  7. endfor

第三種:

  1. for I := to by
  2. dev_close_window ()
  3. *I$表示引用I的值,而 '1d'的 'd'則表示采用十進制數表示,取一位數,如 、 、 此類,
  4. *故 '3d'則表示為取三位十進制數,如 、 、 諸如此類
  5. read_image (Image, 'D:/halcon_test/讀取多張圖檔的方式/'+I$' d ')
  6. get_image_size (Image, Width, Height)
  7. dev_open_window (0, 0, Width, Height, 'black ', WindowHandle)
  8. dev_display (Image)
  9. endfor

第四種:

第四種方法  (讀取一個檔案夾下的所有圖檔)

【助手】-->【打開新的image acquisition 】-->【圖像助手】-->【選擇路徑】-->【代碼生成】-->【插入代碼】

第一種:

  1. ImagePath := []
  2. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  3. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  4. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  5. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  6. ImagePath[ ] := 'D:/halcon_test/讀取多張圖檔的方式/ .jpg'
  7. for Index := to by
  8. dev_close_window ()
  9. read_image (Image, ImagePath[Index])
  10. get_image_size (Image, Width, Height)
  11. dev_open_window ( , , Width, Height, 'black', WindowHandle)
  12. dev_display (Image)
  13. endfor

第二種:

  1. for i := 1 to 5 by 1
  2. dev_close_window ()
  3. read_image (Image, 'D:/halcon_test/讀取多張圖檔的方式/'+i+'.jpg')
  4. get_image_size (Image, Width, Height)
  5. dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
  6. dev_display (Image)
  7. endfor

第三種:

  1. for I := to by
  2. dev_close_window ()
  3. *I$表示引用I的值,而 '1d'的 'd'則表示采用十進制數表示,取一位數,如 、 、 此類,
  4. *故 '3d'則表示為取三位十進制數,如 、 、 諸如此類
  5. read_image (Image, 'D:/halcon_test/讀取多張圖檔的方式/'+I$' d ')
  6. get_image_size (Image, Width, Height)
  7. dev_open_window (0, 0, Width, Height, 'black ', WindowHandle)
  8. dev_display (Image)
  9. endfor

第四種:

第四種方法  (讀取一個檔案夾下的所有圖檔)

【助手】-->【打開新的image acquisition 】-->【圖像助手】-->【選擇路徑】-->【代碼生成】-->【插入代碼】

繼續閱讀