Essentials_Camera_v1.pdf

(6384 KB) Pobierz
ESSENTIALS
GUIDE
TAKE PICTURES AND CAPTURE VIDEO
CAMERA
MODULE
WITH
YOUR
Curated by
THE
Raspberry Pi
Phil King
ESSENTIALS
LEARN | CODE | MAKE
ALSO AVAILABLE:
>
CONQUER THE COMMAND LINE
>
EXPERIMENT WITH SENSE HAT
>
MAKE GAMES WITH PYTHON
>
CODE MUSIC WITH SONIC PI
>
LEARN TO CODE WITH SCRATCH
>
HACK & MAKE IN MINECRAFT
>
ELECTRONICS WITH YOUR PI
>
LEARN TO CODE WITH C
From the makers of the
official Raspberry Pi magazine
ESSENTIALS
OUT NOW
IN PRINT
raspberrypi.org/magpi
ONLY
£4/$7
GET THEM
DIGITALLY:
WELCOME TO
THE CAMERA
MODULE GUIDE
O
ne of the most popular add-ons for
the Raspberry Pi, the official Camera
Module turns your favourite single-
board computer into a powerful digital camera.
Launched back in 2013, the original Camera
Module was succeeded by the higher-spec v2
in April 2016. Even the tiny Pi Zero now has
a camera connector, enabling the creation of
even more amazing projects. In this book we’ll
show you how to get started with the Camera
Module, taking photos and videos from the
command line and writing Python programs
to automate the process. We’ll reveal how to
create time-lapse and slow-motion videos,
before moving on to exciting projects including
a Minecraft photo booth, spy camera, and bird
box viewer. There are just so many things you
can do with a Raspberry Pi and Camera Module!
Phil King
Contributing Editor
FIND US ONLINE
raspberrypi.org/magpi
EDITORIAL
GET IN TOUCH
magpi@raspberrypi.org
DESIGN
Head of Publishing:
Russell Barnes
Contributing Editor:
Phil King
Contributors:
Dan Aldred, Wesley Archer, Richard Hayler
& family, Lorna Lynch, James Singleton, Rob Zwetsloot &
the Raspberry Pi Foundation education team
Critical Media:
criticalmedia.co.uk
Head of Design:
Dougal Matthews
Designers:
Lee Allen, Mike Kay
DISTRIBUTION
THE MAGPI SUBSCRIPTIONS
Select Publisher Services Ltd
PO Box 6337, Bournemouth
BH1 9EH |
+44 (0)1202 586 848
magpi.cc/Subs1
Seymour Distribution Ltd
2 East Poultry Ave, London
EC1A 9PT |
+44 (0)207 429 4000
In print, this product is made using paper
sourced from sustainable forests and
the printer operates an environmental
[
management system which has been
Chapter One
]
assessed as conforming to ISO 14001.
4
This book is published by Raspberry Pi (Trading) Ltd., 30 Station Road, Cambridge, CB1 2JH. The
publisher, editor, and contributors accept no responsibility in respect of any omissions or errors
relating to goods, products or services referred to or advertised in this product. Except where
otherwise noted, content in this magazine is licensed under a Creative Commons Attribution-
NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0). ISBN: 978-1-912047-03-1
[ MASTER THE CAMERA MODULE ]
ESSENTIALS
06
[
CHAPTER ONE
]
GETTING STARTED
Connect your camera
CONTENTS
41
[
CHAPTER SEVEN
]
FLASH PHOTOGRAPHY
USING AN LED
Shoot images in low light
[
PHIL KING
]
10
[
CHAPTER TWO
]
PRECISE CAMERA CONTROL
How to use options and effects
16
[
CHAPTER THREE
]
TIME-LAPSE PHOTOGRAPHY
Create time-lapse sequences
22
[
CHAPTER FOUR
]
HIGH-SPEED PHOTOGRAPHY
Make dazzling slow-motion clips
48
[
CHAPTER EIGHT
]
MAKE A MINECRAFT
PHOTO BOOTH
Take selfies in Minecraft Pi
27
[
CHAPTER FIVE
]
CONTROL THE CAMERA
WITH PYTHON
Start writing Python programs
53
[
CHAPTER NINE
]
BUILD A SPY CAMERA
Set up a motion-activated camera
35
[
CHAPTER SIX
]
STOP-MOTION AND SELFIES
Wire up a physical push button
58
[
CHAPTER TEN
]
TAKE YOUR CAMERA
UNDERWATER
Explore the underwater world
68
[
CHAPTER ELEVEN
]
LIVE-STREAM VIDEO & STILLS
View them on a remote computer
78
[
CHAPTER TWELVE
]
SET UP A SECURITY CAMERA
Protect your home using motionEyeOS
84
[
CHAPTER THIRTEEN
]
INSTALL A BIRD BOX CAMERA
Observe nesting birds with a Pi NoIR
94
[
CHAPTER FOURTEEN
]
QUICK REFERENCE
A guide to the camera, commands,
and Picamera Python library
Phil King is a
Raspberry Pi
enthusiast and
regular contributor
to
The MagPi
magazine.
Growing up in the
‘golden era’ of
8-bit computers in
the 1980s, he leapt
at the chance to
write about them
in magazines such
as CRASH and
ZZAP!64. When
consoles took over
the video games
world, he missed
the opportunity
to program… until
the Raspberry Pi
came along. Phil
is now an avid
coder, electronics
dabbler, and
photographer. He
loves to work on
projects with his
seven-year-old
son – which may
explain the photos
of Playmobil and
Lego you’ll find in
this book!
[
Don’t Panic
]
[
Contents
5
Zgłoś jeśli naruszono regulamin