A video-based motion detection implementation in Python.
Works with Raspberry Pi (https://www.raspberrypi.org/) and Pi Camera (e.g. https://www.raspberrypi.org/products/pi-noir-camera-v2/).
The motion detection code is fast, it takes less than 1 ms for it to complete for 1280x720 video frame size on Raspbery Pi 3B, which allows detecting movements having short duration.
ALTmotion detection example: https://youtu.be/RJU-0Aq_8BQ
screenshot: