RMotion provides a simple interface to build motion detection software in ruby. Many kind of informations about moving entities will be available to applications, and the algorithm is heavily customizable since different cameras record different levels of noise.
RMotion is a ruby library which allows you to read the output of Sudden Motion Sensors on your Apple laptop