【发布时间】:2020-03-03 18:15:54
【问题描述】:
我正在尝试获取 dets 的坐标,以便使用 dlib 库在检测到的面部上方写入名称。
import dlib
detector = dlib.get_frontal_face_detector()
dets = detector(img, 1)
【问题讨论】:
标签: python python-3.x dlib
我正在尝试获取 dets 的坐标,以便使用 dlib 库在检测到的面部上方写入名称。
import dlib
detector = dlib.get_frontal_face_detector()
dets = detector(img, 1)
【问题讨论】:
标签: python python-3.x dlib
你可以参考下面的源码
detector = dlib.get_frontal_face_detector()
dets = detector(img, 1)
for (i, det) in enumerate(dets):
#you can draw name based on faceRect
#to get top left point
top_left_point= det.tl_corner
print (top_left_point.x, top_left_point.y)
【讨论】:
使用 imutils.face_utils rect_to_bb 声明坐标
for det in dets:
(x, y, w, h) = rect_to_bb(det)
【讨论】: