python代码
import cv2 as cv
import numpy as np
def face_detect_demo(image):
gray = cv.cvtColor(image...cv.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2)
cv.imshow("result", image)
print("--------- Python...OpenCV Tutorial ---------")
capture = cv.VideoCapture(0)
cv.namedWindow("result", cv.WINDOW_AUTOSIZE...if c == 27: # ESC
break
cv.waitKey(0)
cv.destroyAllWindows()
XML文件:https://github.com/opencv.../opencv/blob/master/data/haarcascades/haarcascade_frontalface_alt.xml