Raspberry Pi Photo Booth

Associate
Joined
10 Nov 2006
Posts
1,859
Location
Lincoln
Hi guys, I've been tasked with making one of these for a friend. I've built raspberry pi robots before but not had too much to do with the camera or file systems etc.

He doesn't want it to print the photos so that saves some hassle but would like them to be uploaded to facebook as they are taken.

I've done some digging around and currently my best bet seems to be.

Push a button >> Raspberry Pi captures 3 images >> stitch these images together somehow with a banner file >> upload resulting image to drop box.

I have found a service online called wappwolf which will automatically sync dropbox photos to facebook: http://wappwolf.com/dropboxautomator

I think that would be the best solution allowing the raspberry pi to take its photos, process them and dump them to dropbox and then rinse and repeat.

Can anyone see any major flaws with this idea? And would anybody be able to point me in the direction of some information of how to stitch the images together? I am using python predominantly for ease and the number of libraries that exist for it. I am willing to learn new languages if required.

Thanks!
 
Last edited:
Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
I've used ImageMagick before for command line image manipulation. I'm not a pro by any means, but it seems to have a 'montage' method which does what you need.

There's a Python interface for it, so you should be able to use it!
 
Last edited:
Associate
OP
Joined
10 Nov 2006
Posts
1,859
Location
Lincoln
I've used ImageMagick before for command line image manipulation. I'm not a pro by any means, but it seems to have a 'montage' method which does what you need.

There's a Python interface for it, so you should be able to use it!

Brilliant, thanks for the tip, I'll give that a google now.

This is probably quite a nooby question, but how would I go about assigning file names to the completed image before they upload to dropbox?

For instance my current prototyping script is as follows:

Code:
import time
import picamera
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN, GPIO.PUD_UP)

with picamera.PiCamera() as camera:

    def initialise():
        camera.start_preview()

    def captures():
        n = 0
        GPIO.wait_for_edge(17, GPIO>FALLING)
        while n < 3:
            time.sleep(3)
            n = n + 1
            camera.capture('/home/pi/Desktop/BoothCaptures/image' + str(n) + '.jpg')

    def endprogram():
        camera.stop_preview()

    initialise()
    captures()

I have a few issues here.

You can see, I'm assigning the three images captured the filename image'n'.jpg. And this is fine because this means they will be overwritten when the next images are captured. But how do I stop the processed image I output from being overwritten? IE give each processed image a file name such as 001.jpg, 002.jpg, 003.jpg taking into acount what has come before?

I'd like the preview to be constantly displayed but his isn't happening it's closing itself after captures() completes, even if I add another initialise() after the captures() call. I'm not sure how to stop this from happening.

Also I'm unsure whether to use jpg or png files. Using png files noticably slows down the process.
 
Last edited:
Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
Don't you want some sort of loop around the camera.start_preview() call? Maybe until you press the button again or something.

I'd rename the images during the upload to Facebook - you're probably going to have to store the number of images your program has taken somewhere though to use for renaming
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
Facebook used to provide each user with a unique email address that you could email photos to and it would automatically add them to your profile.
Not sure if that still exists but it would probably be the easiest way to do it.
 
Associate
OP
Joined
10 Nov 2006
Posts
1,859
Location
Lincoln
Hi Gents,

Sorry for the slow response have had a hectic few days.

I have, however, had a bit of time to tinker with this further.

I am happy to report I have the script for taking the pictures and uploading to facebook sorted. Now the hard bit, I need to do the work for processing the images as it seems a bit of a cop out to take one picture and post it to facebook. It needs to look akin to a photobooth reel. So I'll be starting work on that soon. The next thing will be to figure out how to make it display only the preview image and none of the raspberry pi command line. Any clues on that one? And then lastly two build an enclosure.
 
Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
ImageMagick will definitely do what you need re: the combining photos to look like a photobooth reel.

I've not done much with the Raspberry Pi camera - what does it display when you start the preview? Isn't there some parameter you can set to hide the console?

Edit: if you mean that the preview doesn't take up the whole screen, it looks like you can set a --fullscreen flag (see here)
 
Last edited:
Associate
OP
Joined
10 Nov 2006
Posts
1,859
Location
Lincoln
ImageMagick will definitely do what you need re: the combining photos to look like a photobooth reel.

I've not done much with the Raspberry Pi camera - what does it display when you start the preview? Isn't there some parameter you can set to hide the console?

Edit: if you mean that the preview doesn't take up the whole screen, it looks like you can set a --fullscreen flag (see here)

Thanks for the reply :).

I'll look through ImageMagick tonight. I more mean making it so the screen is blank until the button is pressed, then you get the preview while it captures the images a preview of the final processed image and then a blank screen again until the next button press. Having had a look around I may be able to do this with Pygame.
 
Back
Top Bottom