face_rec
face_rec copied to clipboard
Blink pattern should be open-closed-open, not closed-open-closed
def isBlinking(history, maxFrames):
""" @history: A string containing the history of eyes status
where a '1' means that the eyes were closed and '0' open.
@maxFrames: The maximal number of successive frames where an eye is closed """
for i in range(maxFrames):
pattern = '1' + '0'*(i+1) + '1'
if pattern in history:
return True
return False
I understand why pattern should be '1' + '0'(i+1) + '1', isn't it '0' + '1'(i+1) + '0'?