Ubuntu系统中除了下载opencv-python阉割版,有什么方法下载opencv

大学生编成新人随便说

import cv2 as cv
from time import sleep

img = cv.imread('./imgs/1.png')

def face_detect_demo():
    gery = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
    face_detect = cv.CascadeClassifier
    face = face_detect.detectMultiScale(gery)
    for x,y,m,h in face:
        cv.rectangle(img, (x, y), color=(0, 0, 255), thickness=3)
    cv.imshow('result.png', img)
face_detect_demo()
cv.waitKey(0)
cv.destroyAllWindows()

this is an english-speaking forum.

do you need a forum in your native language?

That must be necessary!
那肯定需要啊!
Thank you!
谢谢你!

btw, you need to load a pretrained xml cascade file to make it work

谢谢你说明,我清楚我一定缺了点东西
主要是我ubuntu没有下载opencv
只下载了个阉割版opencv-python
在poencv-python中没有你说的训练的 xml 级联文件
(如果说的不对,请随便指正)

you can use one from here

虽然我不会使用github,不过还是说声谢谢