logo

人脸识别中的face(x,y,w,h)值获取

2018-05-27 02:10
T
lsl

如何获取人类识别中face的动态坐标大小参数face(x,y,w,h)值

2018-05-27 12:15
X
Yuan

看文档,里面写的很清楚。

image.find_features(cascade, roi=Auto, threshold=0.5, scale=1.5) (https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html#image.find_features)

这个方法搜索与Haar Cascade匹配的所有区域的图像,并返回一个关于这些特征的边界框矩形元组(x,y,w,h)的列表。若未发现任何特征,则返回一个空白列表。

 objects = img.find_features(face_cascade, threshold=0.75, scale=1.35)
    #image.find_features(cascade, threshold=0.5, scale=1.5),thresholds越大,
    #匹配速度越快,错误率也会上升。scale可以缩放被匹配特征的大小。

    #在找到的目标上画框,标记出来
    # Draw objects
    for r in objects:
        img.draw_rectangle(r)