How to use a Raspberry Pi and a Raspberry Pi camera to make a smart security camera! The camera uses object detection (with OpenCV) to send you an email whenever it sees an intruder. It also runs a webcam so you can view live video from the camera when you are away.
https://www.reddit.com/r/DIY/comments/713eka/heres_how_to_build_your_own_smart_security_camera/