# Python-Motion-Detector
**Repository Path**: wangliang1991/Python-Motion-Detector
## Basic Information
- **Project Name**: Python-Motion-Detector
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-03-22
- **Last Updated**: 2021-03-22
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Python-Motion-Detector
A Python program that can detects moving objects with webcam and log their entry and exit time to/from the camera
# How it works
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 ?
# Screen Shot
# Author
[@Daniel Huang](https://www.linkedin.com/in/daniel-huang-443546115/)