Face detection using Cascade Classifier in opencv python

前端 未结 8 1275
[愿得一人]
[愿得一人] 2020-12-31 21:36

I am using the inbuilt cascade classifier for the face detection. This is how the code is (OpenCV Python Tutorials):

import numpy as np
import cv2

face_casc         


        
8条回答
  •  灰色年华
    2020-12-31 22:11

    In newer versions of opencv haarcascades also gets installed you just need the file location of haarcascades, to get it you can use cv2.data.haarcascades just like shown below

    cascPath = "haarcascade_frontalface_default.xml"
    faceCascade = cv2.CascadeClassifier(cv2.data.haarcascades + cascPath)
    
    

提交回复
热议问题