Motion detection using OpenCV and picamera on the Raspberry Pi