def show_img():
global face_rect
#????????????????
while True:
img = cv.QueryFrame(cam)# ????????
#????????
src=cv.CreateImage((img.width, img.height), 8, 3)
cv.Resize(img,src,cv.CV_INTER_LINEAR)
#??????
gray=cv.CreateImage((img.width, img.height), 8, 1)
cv.CvtColor(img, gray, cv.CV_BGR2GRAY)#?rgb???????
cv.EqualizeHist(gray,gray)#????????????
rects = detect(gray, cascade)#???????????????????????????
face_rect=rects
#?????????
draw_rects(src, rects, (0, 255, 0))
#???????
cv.ShowImage('DeepFace Wang_jun_qian', src)
cv2.waitKey(5) == 27
cv2.destroyAllWindows()
评论列表
文章目录