Face Recognition from photo or camera

開發環境

  1. Windows 10 Professional
  2. Python 3.6
  3. OpenCV 3.3.0

前置作業

1.安裝 OpenCV-Python

先下載下列兩個檔案,到特定的資料夾

http://www.lfd.uci.edu/~gohlke/pythonlibs/tuft5p8b/numpy-1.13.1+mkl-cp36-cp36m-win_amd64.whl

http://www.lfd.uci.edu/~gohlke/pythonlibs/tuft5p8b/opencv_python-3.3.0-cp36-cp36m-win_amd64.whl

(Ignore)http://www.lfd.uci.edu/~gohlke/pythonlibs/tuft5p8b/opencv_python-3.3.0+contrib-cp36-cp36m-win_amd64.whl

再到該資料下,進行安裝

$ pip install numpy-1.13.1+mkl-cp36-cp36m-win_amd64.whl

$ pip install opencv_python-3.3.0-cp36-cp36m-win_amd64.whl

(Ignore)$ pip install opencv_python-3.3.0+contrib-cp36-cp36m-win_amd64.whl

2.辨識特徵檔下載位置

Sources Download from OpenCV releases page

解壓縮後,進入 data 資料夾,將「haarcascades」放到專案的特定資料夾中,以便存取

範例圖片

example01 example02 example03

參考資料

  1. Easy Install OpenCV 3.2 for Python 3.6 / 2.7 on Windows
  2. Install OpenCV 3 with Python 3 on Windows
  3. Docs from opencv.org for videos
  4. Read, Write and Display a video using OpenCV

範例圖片來源

Best free stock photos in one place -- PEXELS

Demo with camera

https://www.youtube.com/watch?v=bZM9Snwsv7s