Octave code for detecting motion.