Advertisement
Guest User

Untitled

a guest
Jan 12th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. resetcount = 0 #the loop counter that resets after a certan value
  2. unknowncount = 0 #the unkown entity counter
  3. knowncount = 0 #the known entity counter
  4. somebodyisinpicture = False;
  5.  
  6. RESET_THRESHOLD = 15
  7. KNOWN_THRESHOLD = 5
  8. UNKNOWN_THRESHOLD = 10
  9.  
  10. while True:
  11.    
  12.     if resetcount > RESET_THRESHOLD:
  13.         unknowncount = 0
  14.         knowncount = 0
  15.         resetcount = 0
  16.        
  17.     #cam stuff
  18.     if somebodyisinpicture:
  19.         #add people from picture to array
  20.         #update known and unknowncount
  21.         for name in names:
  22.             if name.known == True:
  23.                 knowncount = knowncount + 1
  24.             else:
  25.                 unknowncount = unknowncount + 1
  26.                
  27.        
  28.         if knowncount > KNOWN_THRESHOLD:
  29.             #light up green LED
  30.         else if unknowncount > UNKNOWN_THRESHOLD:
  31.             #light up red LED
  32.            
  33.     resetcount = resetcount + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement