关闭检测

2024-04-18 15:41:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我用下面的代码来检测人脸

 detections = face_cascade.detectMultiScale(
    gray,
    scaleFactor=1.1,
    minNeighbors=5,
    minSize=(30, 30),
    flags=cv2.CASCADE_SCALE_IMAGE
)

for i in range(len(detections)):
        face_i = detections[i]
        gray_i = detections[i]
        x, y, w, h = face_i

我只想探测到离摄像机最近的那张脸。我怎么能做到呢?在


Tags: 代码imagecv2cascade人脸faceflagsscale