Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Raspberry Pi for Secret Agents - Second Edition

You're reading from   Raspberry Pi for Secret Agents - Second Edition Turn your Raspberry Pi into your very own secret agent toolbox with this set of exciting projects

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784397906
Length 206 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Stefan Sjogelid Stefan Sjogelid
Author Profile Icon Stefan Sjogelid
Stefan Sjogelid
Arrow right icon
View More author details
Toc

Table of Contents (7) Chapters Close

Preface 1. Getting Up to No Good FREE CHAPTER 2. Audio Antics 3. Webcam and Video Wizardry 4. Wi-Fi Pranks – Exploring Your Network 5. Taking Your Pi Off-road Index

Detecting an intruder and setting off an alarm

Let's dive right into the wonderful world of motion detection!

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime