iT邦幫忙

0

30天AI人臉辨識技術全攻略:從零開始到實戰應用 DAY8

  • 分享至 

  • xImage
  •  

今天使用python的openCV讀取和開啟照片。

1.首先把照片上傳到python:
https://ithelp.ithome.com.tw/upload/images/20241003/20169698O1dNQPOBlG.png

2.再來導入openCV插件,使用指令「import cv2」:
https://ithelp.ithome.com.tw/upload/images/20241003/20169698BGxK3zUGao.png

3.使用指令img = cv2.imread('照片名稱'),此處用zamzam.png來示範:
https://ithelp.ithome.com.tw/upload/images/20241003/20169698ss7HW9sxsn.png

4.使用cv2.imshow('img',img)顯示照片:
https://ithelp.ithome.com.tw/upload/images/20241003/20169698Yq8zNYZ9EQ.png

5.發現照片只有出現一瞬間,用cv2.waitKey(0),單位為ms,使用0代表無限(出現):
https://ithelp.ithome.com.tw/upload/images/20241003/20169698XYKmtcsnss.png

6.發現照片尺寸過大,用img = cv2.resize(img,(324,570))調整大小:
https://ithelp.ithome.com.tw/upload/images/20241003/20169698QiocwyNaA5.png

以上就是今天學習的內容,之後將嘗試人臉辨識。


圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言