ryanbuckner wrote:I wound up using a Python geofence to check if my car is inside the fence. The BMW Connected plug-in return lat long every few minutes.
But, with the AI image recognition, could I tell whether my Alarm is armed (red vs green indicator light) ?
Sent from my iPhone using Tapatalk
im = Image.open('image.gif')
rgb_im = im.convert('RGB')
r, g, b = rgb_im.getpixel((1, 1))
print(r, g, b)
(65, 100, 137)
#!/usr/bin/python3
from shapely.geometry import Point, Polygon
import sys
def main():
coords = [
(39.008234937234256, -77.37684452531161),
(39.00809324520176, -77.37627518191934),
(39.00733602026089, -77.37671994280922),
(39.0076547326009, -77.37724949835487)
]
homeFence = Polygon(coords)
arglat = float(sys.argv[1])
arglong = float(sys.argv[2])
bmw = Point(arglat, arglong)
print("{}".format(bmw.within(homeFence)), file = sys.stdout)
if __name__ == "__main__":
main()
Users browsing this forum: No registered users and 1 guest