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
63
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
460
Live Highlights in BBC iPlayer
bennuttall
0
140
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
200
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
140
Running a Python Package Index for Raspberry Pi
bennuttall
0
170
From Acorns to Raspberries
bennuttall
0
150
Innovation in the newsroom
bennuttall
0
200
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
220
How to market your open source project
bennuttall
0
260
Other Decks in Programming
See All in Programming
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
130
AI活用のコスパを最大化する方法
ochtum
0
260
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
150
CSC307 Lecture 15
javiergs
PRO
0
260
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1k
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2k
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
230
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
490
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
410
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
690
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
150
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
81
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
290
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
85
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
4 Signs Your Business is Dying
shpigford
187
22k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
280
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
640
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
380
Joys of Absence: A Defence of Solitary Play
codingconduct
1
320
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
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