Face detection using Cascade Classifier in opencv python

前端 未结 8 1135
[愿得一人]
[愿得一人] 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:32

    Maybe, you use virtualenv for python like me. You try this.

    import os
    
    base_directory = os.path.abspath(os.getcwd())
    directory_cv2 = os.path.join(base_directory, "Lib", "site-packages", "cv2","data")
    print("la carpeta es: {}".format(directory_cv2))
    
    0 讨论(0)
  • 2020-12-31 22:35

    I faced the same problem. First you will have to give the correct path of the file to the system, which looks like this: /home/xxxx/Desktop/Projects/haarcascade_eye.xml. Next, you'll have to open the code on github and save the raw version of the code for it run. It's advisable for both the files to be in the folder where you are storing your project file. Happy coding

    0 讨论(0)
提交回复
热议问题