eloquentarduino / EloquentArduino

IO, scheduling, utils, machine learning... for Arduino
https://eloquentarduino.github.io/EloquentArduino/
164 stars 59 forks source link

the motion detect when turned the light on and off #19

Closed endermaxximum closed 3 years ago

endermaxximum commented 3 years ago

How can I set the sensitivity of the motion detect? Because when I only turned the light off the camera was detected the motion (this happened with turned light on also).

eloquentarduino commented 3 years ago

"Motion detection" is actually a bit misleading as name. The library detects any substantial change in the pixels' values: when you turn the light off, all the pixels go from light to almost black, so "motion" is detected (the same when you turn the light on). It is intended behavior, and you cannot set any sensitivity to change this. What you can try to do, instead, is putting an upper threshold on the detector ratio(): if it is too high (> 90% for example), don't trigger the motion detection.

endermaxximum commented 3 years ago

thank you