|
@@ -63,12 +63,22 @@ class FaceLocation():
|
|
|
|
|
|
process_this_frame = process_this_frame + 1
|
|
|
|
|
|
+ # 超时没有检测到人脸则自动移动到原始位置
|
|
|
if (len(face_locations) == 0 and (not onceMoveOrgDeg)):
|
|
|
checkTime = rospy.get_time()
|
|
|
if((checkTime-recordTime) > self.face_detect_timeout):
|
|
|
self.moveServoOrgDeg()
|
|
|
onceMoveOrgDeg = True
|
|
|
|
|
|
+ """
|
|
|
+ 此处可以加入自己的行为检测代码,比如眨眼、张嘴等
|
|
|
+ """
|
|
|
+
|
|
|
+
|
|
|
+ """
|
|
|
+ 自定义代码结束
|
|
|
+ """
|
|
|
+
|
|
|
# calculate face center ready to move servo
|
|
|
for (top, right, bottom, left) in face_locations:
|
|
|
onceMoveOrgDeg = False
|