A Python program that can detects moving objects with webcam and log their entry and exit time to/from the camera
The script "motion_detector.py" utilizes the openCV library to capture video from the default webcam of the loacal machine. and we basically store the first frame, which ideally would capture the static background, and then check every coming frame captured from the camera to see if the difference (delta) in all pixels surpasses the set threshold. If it does, we draw rectangular contours on the frame to indicate where the detected objects are.
After we are able to successfully detect the moving objects, the next step is to record the entry and exit points in time and plot a time series with my second script- "plotting.py". The time series chart is plotted with the bokeh library and we also enable hovering effect to show the time stamps. The only thing left to do is to fine tune the parameters such as the threshold in order to make the detection more accurate. Pretty fun, right ?
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。