shantnu / FaceDetect

825 stars 1.25k forks source link

module 'cv2.cv2' has no attribute 'cv' #31

Open seyedmohammadmousavi opened 3 years ago

seyedmohammadmousavi commented 3 years ago

font=cv2.cv.InitFont(cv2.cv.cv_FONT_HERSHEY_COMPLEX_SMALL,1,1,0,1)

when I write this the error of module 'cv2.cv2' has no attribute 'cv' come:( help me plsssss

AzethMeron commented 3 years ago

Appearantly here's solution to this (well, similar) problem: https://github.com/shantnu/FaceDetect/issues/21 But for me, installing contrib package didn't solve anything.

0xCwrw commented 2 years ago

Opencv removed the attribute in one of the updates, the alternative which works is cv2.CASCADE_SCALE_IMAGE. For more info: https://stackoverflow.com/questions/41341409/where-is-cv-haar-scale-image-in-opencv-3-1-0-with-python-3-5