Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
South London Pioneers - Picamera
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ben Nuttall
May 21, 2017
Programming
67
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
South London Pioneers - Picamera
Ben Nuttall
May 21, 2017
Transcript
14 slides
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
More Decks by Ben Nuttall
See All by Ben Nuttall
Numeronyms are obnoxious
bennuttall
1
790
Live Highlights in BBC iPlayer
bennuttall
0
200
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
260
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
200
Running a Python Package Index for Raspberry Pi
bennuttall
0
230
From Acorns to Raspberries
bennuttall
0
190
Innovation in the newsroom
bennuttall
0
250
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
270
How to market your open source project
bennuttall
0
310
Other Decks in Programming
See All in Programming
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
160
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
320
AI-Powered Domain-Driven Design
ziobrando
0
470
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
120
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
220
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
270
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
160
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
200
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
330
How GitHub (no longer) Works
holman
316
150k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
580
Discover your Explorer Soul
emna__ayadi
2
1.3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Utilizing Notion as your number one productivity tool
mfonobong
4
650
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
670
The Invisible Side of Design
smashingmag
301
52k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.7k