Black Image returned from printer webcam #5

Open
opened 2019-12-18 02:50:23 +00:00 by Rich · 0 comments
Rich commented 2019-12-18 02:50:23 +00:00 (Migrated from gitlab.rickelobe.com)

Sometimes a black image is returned from the printer's webcam. Not sure if this is a problem w/ the webcam or a delay in HomeAssistant's turning on of the light. Should be checking the returned image, or HomeAssistant to verify the light was turned on.

Code snippet to check image brightness:

def brightness( im_file ):
   im = Image.open(im_file).convert('L')
   stat = ImageStat.Stat(im)
   return stat.rms[0]

Source of code snippet

Screenshot of the issue:Screen_Shot_2019-12-17_at_9.49.08_PM

Sometimes a black image is returned from the printer's webcam. Not sure if this is a problem w/ the webcam or a delay in HomeAssistant's turning on of the light. Should be checking the returned image, or HomeAssistant to verify the light was turned on. Code snippet to check image brightness: ```py def brightness( im_file ): im = Image.open(im_file).convert('L') stat = ImageStat.Stat(im) return stat.rms[0] ``` [Source of code snippet](https://stackoverflow.com/questions/3490727/what-are-some-methods-to-analyze-image-brightness-using-python) Screenshot of the issue:![Screen_Shot_2019-12-17_at_9.49.08_PM](/uploads/8eb4a491ecaceef2845f19e298214d05/Screen_Shot_2019-12-17_at_9.49.08_PM.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rich/r0b3BOT#5