RasPi Magazine 11.pdf

(9081 KB) Pobierz
ESIGN
D
UILD
B
CODE
11
MOTION
FACES
AND
DETECT
drum machine
Plus
Code a
Welcome
Picamera is a fantastic library
for the Raspberry Pi camera
module, and we took a good
look at it back in issue 6, but
you can do so much more with your camera
module – and even USB cameras, if you’re
controlling them with your Raspberry Pi.
Did you know that you can set up a regular
webcam to recognise faces, for example? Or
that you can create a
Matrix-style
bullet time
effect by chaining lots of camera modules
together? We’ll show you how it’s done and
more in this special camera tricks issue of
RasPi.
And if photography isn’t your passion,
don’t worry – we’ve also got a great audio
sampler project for you, plus guides to mining
Bitcoins and volunteering CPU power. Enjoy!
Get inspired
Discover the RasPi
community’s best projects
Expert advice
Got a question? Get in touch
and we’ll give you a hand
Easy-to-follow
guides
Learn to make and code
gadgets with Raspberry Pi
Editor
From the makers of
Join the conversation at…
@linuxusermag
xusermag
Linux User & Developer
inux U
Develope
D l
RasPi@imagine-publishing.co.uk
RasPi@imagine p
Contents
Create a time-lapse camera
Shooting with your DSLR is a cinch
Detect motion with picamera
Use your camera module for home security
Turn a USB camera into a motion sensor
Add facial recognition to your surveillance setup
Bullet Pi
How to freeze time using 48 camera modules
Make a drum machine
Code a looping sampler for Pi-driven beats
What is ARM?
Exploring the brain of your Raspberry Pi
Mine Bitcoins
Find out how to dig for virtual gold
Volunteer CPU power with BOINC
Help scientists fold proteins and search for aliens
Talking Pi
Your questions answered and your opinions shared
Create a time-lapse camera
Shooting time-lapse video with your DSLR camera is a
cinch if you get Python and your Pi involved
You’d be forgiven for thinking that creating
mesmerising time-lapse videos like those
of Vincent Laforet (www.laforetvisuals.com)
or John Eklund (www.theartoftimelapse.com) might
be out of reach of the Average Joe, but with the help of
the Raspberry Pi and a sprinkling of Python code, that’s
no longer the case. In this guide we’re going to use our
Raspberry Pi to trigger our run-of-the-mill DSLR camera
(in this case a Canon EOS) to create pixel-perfect time-
lapse imagery for little more than £10. Here’s how…
THE PROJECT
ESSENTIALS
Breadboard,
connectors,
jumper wire
DSLR camera
Compatible shutter
cable
Raspbian with
Python 2.7
01
Set up the Raspberry Pi
For this tutorial we’re assuming you’re using a recent
build of Raspbian, which you can download from
www.raspberrypi.org/downloads.
With the Raspberry
Pi set up with a keyboard, mouse and monitor, open
the terminal and type:
$ sudo apt-get update
02
Install the RPi.GPIO library
Next we want to make sure your development
environment is set up. Users of Raspian should be
set up already, but you should follow these steps
anyway to make sure. In the terminal, type:
“We’re
going
to use our
Raspberry Pi
to trigger our
run-of-the-mill
DSLR camera
to create pixel-
perfect time-
lapse imagery”
$ sudo apt-get install python-dev
$ sudo apt-get install
python-rpi.gpio
03
Set up the Pi Cobbler
With the development environment set up,
we can turn our attention to the hardware.
For this tutorial we’ve used a cheap
prototyping breadboard and an Adafruit
Zgłoś jeśli naruszono regulamin