paviro / MMM-Facial-Recognition-Tools

Tools to setup and train the facial recognition module for the MagicMirror.
43 stars 23 forks source link

Run the picam in a separate thread #6

Closed dmcinnes closed 8 years ago

dmcinnes commented 8 years ago

Hello! I've updated the picam code to run the camera in a separate thread. I have my mirror in a relatively low-light environment, so having the camera run for a while before I start capturing helps considerably.

paviro commented 8 years ago

Thanks for your effort! Will merge it later today :) could you explain a bit further what the benefit is so I reall understand it?

dmcinnes commented 8 years ago

Sure! Mostly the benefit will be seen on https://github.com/paviro/MMM-Facial-Recognition PR https://github.com/paviro/MMM-Facial-Recognition/issues/13 but I've updated here as well for consistency. Mostly it was due to having the the camera re-initialize on each requested frame. I was tweaking the settings to try and get 'night' mode enabled but it doesn't do until until it has a few seconds to detect what the scene looks like. Having it run consistently will give it the best chance to take a good quality picture. This will also likely help performance overall (at least when the full MagicMirror is running) since it will not re-initialize the camera object on each request. I haven't compared the performance, however.

paviro commented 8 years ago

Alright thank you! :)

dmcinnes commented 8 years ago

@paviro thanks for making such a great plugin! 😃