Hardware Reference
In-Depth Information
The basic idea of motion detection is pretty simple from a computer's point of
view—the motion detection software processes a continuous stream of images and
analyzes the positions of the pixels that make up the image. If a group of contiguous
pixels above a certain threshold starts to change from one frame to the next, that
must be something moving. The tricky part of motion detection is weeding out false
positives triggered by naturally occurring changes in light and weather conditions.
The steps to configure motion detection are as follows:
1.
We'll be working with a motion detection application called Motion. Install it
using the usual command:
pi@raspberrypi ~ $ sudo apt-get install motion
With Motion installed, the next step is to create a configuration file for our
camera. The Motion installation puts a sample configuration file inside the /
etc/motion directory. We will use this configuration file as a template and
modify it for our needs.
2. Create a configuration directory for Motion in your home directory with the
following command:
pi@raspberrypi ~ $ mkdir ~/.motion
3. Then copy the example configuration from /etc/motion into your
new directory:
pi@raspberrypi ~ $ sudo cp /etc/motion/motion.conf ~/.motion
4. The configuration file is still owned by the root user, so let's make it ours
using the chown command:
pi@raspberrypi ~ $ sudo chown pi:pi ~/.motion/motion.conf
5. Now we can open up the configuration file for editing:
pi@raspberrypi ~ $ nano ~/.motion/motion.conf
Creating an initial Motion configuration
Motion has plenty of options to explore, and it's easy to be overwhelmed by them all.
What we're aiming for, at this point, is to get a basic demonstration setup going with
as few bells and whistles as possible. Once we've established that the main motion
detection functionality is working as expected, we can move on to the advanced,
extra features of Motion.
Apart from the regular, helpful comments preceded by the # character, the ; character
is used to make individual configuration directives inactive. ; tunerdevice /dev/
tuner0 , for example, means that the line will be ignored by Motion.
 
Search WWH ::




Custom Search