python ubuntu dlib 8- 输出人脸坐标

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/csharp25/article/details/84715418

输入图片检测人脸,输出人脸坐标

import sys
import dlib
if len(sys.argv) < 1:
	print("need specify the image file")
	exit()

image_file = sys.argv[1]
img = dlib.load_rgb_image(image_file)

# Locations of candidate objects will be saved into rects
rects = []
dlib.find_candidate_object_locations(img, rects, min_size=500)

print("number of rectangles found {}".format(len(rects))) 
for k, d in enumerate(rects):
    print("Detection {}: Left: {} Top: {} Right: {} Bottom: {}".format(
        k, d.left(), d.top(), d.right(), d.bottom()))

猜你喜欢

转载自blog.csdn.net/csharp25/article/details/84715418