added milo strats

This commit is contained in:
Mikkel Milo 2019-04-06 13:18:24 +02:00
parent 150f2f33b1
commit 94b312d9b7
3 changed files with 25 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 KiB

View 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())

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB