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
58
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
410
Live Highlights in BBC iPlayer
bennuttall
0
120
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
180
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
120
Running a Python Package Index for Raspberry Pi
bennuttall
0
150
From Acorns to Raspberries
bennuttall
0
130
Innovation in the newsroom
bennuttall
0
170
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
200
How to market your open source project
bennuttall
0
240
Other Decks in Programming
See All in Programming
Developing Specifications - Jakarta EE: a Real World Example
ivargrimstad
0
190
Micro Frontendsで築いた 共通基盤と運用の試行錯誤 / Building a Shared Platform with Micro Frontends: Operational Learnings
kyntk
0
130
Flutterチームから作る組織の越境文化
findy_eventslides
0
580
詳細の決定を遅らせつつ実装を早くする
shimabox
2
1.3k
Chart.jsで長い項目を表示するときのハマりどころ
yumechi
0
150
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
7
9.2k
アーキテクチャと考える迷子にならない開発者テスト
irof
9
3.3k
Private APIの呼び出し方
kishikawakatsumi
3
900
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
7.2k
AIエージェントでのJava開発がはかどるMCPをAIを使って開発してみた / java mcp for jjug
kishida
4
770
関数の挙動書き換える
takatofukui
4
750
AWS CDKの推しポイントN選
akihisaikeda
1
170
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
57k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
680
For a Future-Friendly Web
brad_frost
180
10k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
It's Worth the Effort
3n
187
29k
Speed Design
sergeychernyshev
33
1.2k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
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