added milo strats
This commit is contained in:
parent
150f2f33b1
commit
94b312d9b7
BIN
server/nightr/strategies/day.png
Normal file
BIN
server/nightr/strategies/day.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 576 KiB |
25
server/nightr/strategies/miloStrats.py
Normal file
25
server/nightr/strategies/miloStrats.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import cv2
|
||||
from datetime import datetime, timedelta
|
||||
from pytz import timezone
|
||||
|
||||
def camImgStrat():
|
||||
img = cv2.imread('night.jpg',0)
|
||||
average = img.mean(axis=0).mean(axis=0)
|
||||
print(average)
|
||||
if average < 100:
|
||||
return 1.0
|
||||
else:
|
||||
return 0.0
|
||||
|
||||
|
||||
def australiaStrat():
|
||||
australia = timezone('Australia/Melbourne')
|
||||
t = datetime.now().astimezone(australia)
|
||||
hour = t.hour
|
||||
if hour > 22 or hour < 6:
|
||||
return 1.0
|
||||
else:
|
||||
return 0.0
|
||||
|
||||
|
||||
print(australiaStrat())
|
BIN
server/nightr/strategies/night.jpg
Normal file
BIN
server/nightr/strategies/night.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
Loading…
Reference in a new issue