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
33
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
48
Live Highlights in BBC iPlayer
bennuttall
0
21
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
89
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
44
Running a Python Package Index for Raspberry Pi
bennuttall
0
56
From Acorns to Raspberries
bennuttall
0
36
Innovation in the newsroom
bennuttall
0
51
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
100
How to market your open source project
bennuttall
0
140
Other Decks in Programming
See All in Programming
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
370
新宿ダンジョンを可視化してみた
satoshi7190
2
230
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
530
Milestoner
bkuhlmann
1
410
Semantic search with Django and pgvector
pauloxnet
0
240
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
330
使ってみよう Azure AI Document Intelligence
kosmosebi
2
290
ゆるい個人開発のススメ
kuroppe1819
10
980
Ruby Function Composition
bkuhlmann
1
330
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
890
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
380
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
Featured
See All Featured
Code Review Best Practice
trishagee
55
15k
Designing for humans not robots
tammielis
248
25k
Designing for Performance
lara
601
67k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
Atom: Resistance is Futile
akmur
259
25k
Writing Fast Ruby
sferik
621
60k
What's in a price? How to price your products and services
michaelherold
237
11k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
120
39k
Git: the NoSQL Database
bkeepers
PRO
422
63k
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