Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
South London Pioneers - Picamera
Search
Ben Nuttall
May 21, 2017
Programming
1
41
South London Pioneers - Picamera
Ben Nuttall
May 21, 2017
Tweet
Share
More Decks by Ben Nuttall
See All by Ben Nuttall
Numeronyms are obnoxious
bennuttall
0
380
Live Highlights in BBC iPlayer
bennuttall
0
110
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
170
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
110
Running a Python Package Index for Raspberry Pi
bennuttall
0
150
From Acorns to Raspberries
bennuttall
0
120
Innovation in the newsroom
bennuttall
0
130
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
190
How to market your open source project
bennuttall
0
240
Other Decks in Programming
See All in Programming
Catch Up: Go Style Guide Update
andpad
0
200
Cloudflare AgentsとAI SDKでAIエージェントを作ってみた
briete
0
130
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
150
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
120
クラシルを支える技術と組織
rakutek
0
200
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
8
5.5k
CSC509 Lecture 01
javiergs
PRO
1
440
Signals & Resource API in Angular: 3 Effective Rules for Your Architecture @BASTA 2025 in Mainz
manfredsteyer
PRO
0
110
CSC305 Lecture 03
javiergs
PRO
0
240
Playwrightはどのようにクロスブラウザをサポートしているのか
yotahada3
7
2.3k
Conquering Massive Traffic Spikes in Ruby Applications with Pitchfork
riseshia
0
160
iOS 17で追加されたSubscriptionStoreView を利用して5分でサブスク実装チャレンジ
natmark
0
650
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Done Done
chrislema
185
16k
Making Projects Easy
brettharned
119
6.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
19
1.2k
Automating Front-end Workflow
addyosmani
1371
200k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Building an army of robots
kneath
306
46k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
KATA
mclloyd
32
15k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Transcript
Python Picamera with the Sense HAT Introducing the camera board
and Python module
Raspberry Pi camera module - 5Mpx / 8Mpx - Full
HD - Photo & video - Command line - Python module - Infra-red camera
Connect the camera
Open Python 3
IDLE Python Shell >>> from picamera import PiCamera >>> from
sense_hat import SenseHat >>> camera = PiCamera() >>> sense = SenseHat() >>> sense.stick.direction_up = camera.start_preview >>> sense.stick.direction_down = camera.stop_preview
Open a new file • File > New File •
File > Save • Save as camera.py
Take a selfie from picamera import PiCamera from time import
sleep camera = PiCamera() camera.start_preview() sleep(3) camera.capture("/home/pi/image.jpg") camera.stop_preview() Save and run: Ctrl + S F5
Add joystick code from picamera import PiCamera from sense_hat import
SenseHat from time import sleep camera = PiCamera() sense = SenseHat() camera.start_preview() sense.stick.wait_for_event(True) sleep(3) camera.capture("/home/pi/sense.jpg") camera.stop_preview()
Picamera effects
Picamera effects camera.start_preview() sense.stick.wait_for_event(True) camera.image_effect = 'negative' sleep(5) camera.capture("/home/pi/negative.jpg") camera.stop_preview()
Try more effects: - negative - colorswap - sketch - emboss
Picamera effects import random camera.start_preview() for i in range(5): sense.stick.wait_for_event(True)
effect = random.choice(list(camera.IMAGE_EFFECTS)) camera.image_effect = effect camera.annotate_text = effect sleep(5) camera.capture("/home/pi/{}.jpg".format(effect)) camera.stop_preview() Try more effects: - negative - colorswap - sketch - emboss
Documentation and help guides • picamera.readthedocs.io • pythonhosted.org/sense-hat • raspberrypi.org/resources
What next? • Time-lapse • Stop motion animation • Wildlife
camera
What next? • Sensor trigger • Send to social media
• Robotics