Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resetcount = 0 #the loop counter that resets after a certan value
- unknowncount = 0 #the unkown entity counter
- knowncount = 0 #the known entity counter
- somebodyisinpicture = False;
- RESET_THRESHOLD = 15
- KNOWN_THRESHOLD = 5
- UNKNOWN_THRESHOLD = 10
- while True:
- if resetcount > RESET_THRESHOLD:
- unknowncount = 0
- knowncount = 0
- resetcount = 0
- #cam stuff
- if somebodyisinpicture:
- #add people from picture to array
- #update known and unknowncount
- for name in names:
- if name.known == True:
- knowncount = knowncount + 1
- else:
- unknowncount = unknowncount + 1
- if knowncount > KNOWN_THRESHOLD:
- #light up green LED
- else if unknowncount > UNKNOWN_THRESHOLD:
- #light up red LED
- resetcount = resetcount + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement