@boomlikethat: With the camera in preview or stills mode, it can go to long-exposure "night" mode, at least 1/4 second or more. But when recording video (including if you have the buffer enabled, meaning it is video recording to buffer all the time) it uses a short exposure to maintain 25 fps so the image is much darker. IMHO the RPi camera isn't the right solution if you want moving images at night. If you do use an IR or any kind of light, it should be shining through a completely different piece of glass, otherwise multiple internal reflections within the glass get back to the camera and end up washing out your image. Look at any outdoor camera with IR, you'll see the camera glass and IR LED glass covers are separate.
boomlikethat wrote:This is cool! The idea that it also shows coordinates could make it really useful. Thanks for sharing!
Actually, the stock 'motion' program can also give you the upper-left and lower-right coordinates of the detected motion area, but it tends to be a rough approximation. It is useful for example, to generate a thumbnail showing only the motion area instead of the whole frame. OpenCV gives you more tools and parameters to tweak to separate out the motion of interest from the possibly noisy background, so I find it better at tracking an object moving across the frame .