我使用以下代码来检测面部
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
我希望只检测距离相机最近的脸部。我怎么能这样做?