diff --git a/Test Photos/daylight_photo_1.jpg b/Test Photos/daylight_photo_1.jpg new file mode 100644 index 0000000..dd2392d Binary files /dev/null and b/Test Photos/daylight_photo_1.jpg differ diff --git a/Test Photos/daylight_photo_2.jpg b/Test Photos/daylight_photo_2.jpg new file mode 100644 index 0000000..16725de Binary files /dev/null and b/Test Photos/daylight_photo_2.jpg differ diff --git a/Test Photos/nighttime_photo_1.jpg b/Test Photos/nighttime_photo_1.jpg new file mode 100644 index 0000000..25f4ddc Binary files /dev/null and b/Test Photos/nighttime_photo_1.jpg differ diff --git a/Test Photos/nighttime_photo_2.jpg b/Test Photos/nighttime_photo_2.jpg new file mode 100644 index 0000000..cd3d68f Binary files /dev/null and b/Test Photos/nighttime_photo_2.jpg differ diff --git a/Test Photos/nighttime_photo_3.jpg b/Test Photos/nighttime_photo_3.jpg new file mode 100644 index 0000000..84a006d Binary files /dev/null and b/Test Photos/nighttime_photo_3.jpg differ diff --git a/Test Photos/nighttime_photo_4.jpg b/Test Photos/nighttime_photo_4.jpg new file mode 100644 index 0000000..349557c Binary files /dev/null and b/Test Photos/nighttime_photo_4.jpg differ diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..fe2c73b --- /dev/null +++ b/notes.md @@ -0,0 +1,11 @@ +# Snapshot url +http://192.168.0.16:8765/picture/1/current/?_username=admin&_signature=4c839a546045ccf433f24e6cd62ec7e1e5334f7a + +# Brightness function reference +https://stackoverflow.com/questions/3490727/what-are-some-methods-to-analyze-image-brightness-using-python + +# Functions To-do List +- [ ] Grab snapshot from camera stream +- [ ] Calculate brightness from camera stream +- [ ] output brightness to terminal +- [ ] interface brightness to node-red/home-assistant system diff --git a/test.py b/test.py new file mode 100644 index 0000000..8f13fd3 --- /dev/null +++ b/test.py @@ -0,0 +1,5 @@ +def brightness( im_file ): + im = Image.open(im_file) + stat = ImageStat.Stat(im) + r,g,b = stat.mean + return math.sqrt(0.241*(r**2) + 0.691*(g**2) + 0.068*(b**2))