A Remix of the Raspberry Pi Foundation's All Seeing Pi
If you are looking for a challenge, or wish to learn some coding basics for Raspberry Pi while setting up your photo booth, we encourage you to follow the Pi Foundation's instructions at their website here.
This tutorial is a remix of the Pi Foundation's original learning resource. We added additional buttons to ours, mixed up the overlays, and changed a few things around in the code. The Facet Photo Booth operates without a mouse or keyboard, making it a good choice for large groups of people (especially children), or for those who want a sleeker look. The Pi Foundation also created neat housing for their booth, and includes instructions for those who wish to use a touchscreen LCD with their photo booth.
Now, on to the instructions!
Included in Facet's "Raspberry Pi Photo Booth Starter Kit"
Raspberry Pi 2 or 3, Model B
This tutorial is written for a Pi 3 loaded with NOOBS, connected to the internet without any special configuration. You can find SD cards pre-loaded with NOOBS at Facet Technologies and Nerds on Call.
Raspberry Pi Camera
8 Male-Female Jumper Wires (plus some for extensions, if needed)
Breadboard
4 Tactile Push Buttons (3 if you do not wish to Tweet with your photo booth)
Monitor or Projector
sudo apt-get install -y python3-picamera python3-pip
sudo pip3 install guizero
sudo pip3 install twython
sudo apt-get install -y python3-PIL
next_overlay_btn = Button(23)
next_overlay_btn.when_pressed = next_overlay
take_pic_btn = Button(25)
take_pic_btn.when_pressed = take_picture
new_pic_btn = Button(17)
new_pic_btn.when_pressed = new_picture
send_tweet_btn = Button(19)
send_tweet_btn.when_pressed = send_tweet
def next_overlay():
print("Next overlay")
def take_picture():
print("Take a picture")
def send_tweet():
print("Send Tweet")
def new_picture():
print("New picture")
# WITHOUT TWITTER
from picamera import PiCamera
from gpiozero import Button
from overlay_functions import *
from time import localtime, strftime, time
from guizero import App, PushButton, Text, Picture
def next_overlay():
global overlay
overlay = next(all_overlays)
preview_overlay(camera, overlay)
def take_picture():
global output
output = strftime("/home/pi/facetphotobooth/image-%d-%m %H:%M.png", localtime())
camera.capture(output)
camera.stop_preview()
remove_overlays(camera)
output_overlay(output,overlay)
size = 400, 400
gif_img = Image.open(output)
gif_img.thumbnail(size, Image.ANTIALIAS)
gif_img.save(latest_photo, 'gif')
your_pic.set(latest_photo)
next_overlay_btn = Button(23)
next_overlay_btn.when_pressed = next_overlay
take_pic_btn = Button(25)
take_pic_btn.when_pressed = take_picture
camera = PiCamera()
camera.resolution = (800, 480)
camera.hflip = True
camera.start_preview ()
output = ""
latest_photo = '/home/pi/facetphotobooth/latest.gif'
def take_picture() :
camera.capture(output)
camera.stop_preview()
remove_overlays(camera)
output_overlay(output, overlay)
def new_picture():
camera.start_preview()
preview_overlay(camera, overlay)
new_pic_btn = Button(17)
new_pic_btn.when_pressed = new_picture
app = App("The Facet Photo Booth", 800, 480)
message = Text(app, "I spotted you!")
your_pic = Picture(app, latest_photo)
new_pic = PushButton(app, new_picture, text="New picture")
app.display()
# WITH TWITTER
from picamera import PiCamera
from gpiozero import Button
from overlay_functions import *
from time import localtime, strftime, time
from guizero import App, PushButton, Text, Picture
from twython import Twython
from auth import (
consumer_key,
consumer_secret,
access_token,
access_token_secret
)
def next_overlay():
global overlay
overlay = next(all_overlays)
preview_overlay(camera, overlay)
def take_picture():
global output
output = strftime("/home/pi/facetphotobooth/image-%d-%m %H:%M.png", localtime())
camera.capture(output)
camera.stop_preview()
remove_overlays(camera)
output_overlay(output,overlay)
size = 400, 400
gif_img = Image.open(output)
gif_img.thumbnail(size, Image.ANTIALIAS)
gif_img.save(latest_photo, 'gif')
your_pic.set(latest_photo)
next_overlay_btn = Button(23)
next_overlay_btn.when_pressed = next_overlay
take_pic_btn = Button(25)
take_pic_btn.when_pressed = take_picture
camera = PiCamera()
camera.resolution = (800, 480)
camera.hflip = True
camera.start_preview ()
output = ""
latest_photo = '/home/pi/facetphotobooth/latest.gif'
def take_picture() :
camera.capture(output)
camera.stop_preview()
remove_overlays(camera)
output_overlay(output, overlay)
def new_picture():
camera.start_preview()
preview_overlay(camera, overlay)
def send_tweet():
twitter = Twython(
consumer_key,
consumer_secret,
access_token,
access_token_secret
)
message = "Spotted by the Facet Photo Booth! #raspberrypi #coolestnerds"
with open(output, 'rb') as photo:
twitter.update_status_with_media(status=message, media=photo)
new_pic_btn = Button(17)
new_pic_btn.when_pressed = new_picture
send_tweet_btn = Button(19)
send_tweet_btn.when_pressed = send_tweet
app = App("The Facet Photo Booth", 800, 480)
message = Text(app, "I spotted you!")
your_pic = Picture(app, latest_photo)
new_pic = PushButton(app, new_picture, text="New picture")
tweet_pic = PushButton(app, send_tweet, text="Tweet picture")
app.display()
Nerds on Call will take care of you! If you have computer problems, call them up! They have remotely fixed my computer many times. If I need accessories, I just call them up, and they send them directly to my home right away! I am out of state, and get my orders very quickly!
Peoria Location
Monday - Friday: 8 am - 6 pm
Saturday: 9 am - 1 pm
Normal Location
Monday - Friday: 8 am - 6 pm
Saturday: 9 am - 1 pm
Pekin Location
Monday - Friday: 8 am - 6 pm
Saturday: 9 am - 1 pm