ret, frame = cap.read()
x1 = faces[0]
y1 = faces[1]
x2 = faces[2]
y2 = faces[3]
face_box = [x1, y1, x2, y2]
box_roi = frame[face_box[1]:face_box[3] - 1, face_box[0]:face_box[2] - 1, :]
#bgr_img2[10:face_box[3] -face_box[1]+9, 10:face_box[2] -face_box[0]+9] = box_roi
cv2.imwrite("bgr_img.jpg",bgr_img2)
name += 1
cv2.imwrite(image_dir+str(name)+".jpg",img)
cv2.imwrite(save_dir+os.path.basename(image_file),img)