Halovision APP
The Halovision plugin measures the amount of change between each frame from the camera. It can be configured to play audio tracks when any motion is detected or when rapid eye movement patterns are detected during a dream: electrooculography (EOG).
The REM detection algorithm is experimental. It will clearly only work during an afternoon nap or with a night-light on. It can be tested by blinking six times in a row, with two seconds between each blink. You have to be completely still. The idea is to place the phone on a nightstand with the camera facing the bed. Then lie on your side facing the nightstand.