mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Thought id share: Wedding Photo Booth [FULL SOURCE]

Mon Apr 28, 2014 10:40 pm

Thought i'd share my almost finished project...

So after my brother got a quote for £800 to hire a wedding photobooth for his wedding i told him i would make one for a tenth of the price.

The theory and practice is pretty simple, as i am going to the wedding i didn't want to be hanging around by it, so it had to be totally self sufficient and cheap.

Most of the stuff i had lying around

So heres what i took:

Raspberry PI Model B (just cause i had one)
PI Camera Module
SparkFun 100mm Red Button
USB Hub
5" TFT Screen (again i have 5 i've never used)
Canon Selphy CP910i Photo Printer
Laptop 12v 4A Power Supply
UBEC

Combine them all together with some python code and prior to the printer arriving i ended up with this which shows you the internals:

https://www.youtube.com/watch?v=3zqu2o5j-iI

After some more fettling and woodwork this is where im at just now, pretty much complete just some final code changes to make it more robust:

https://www.youtube.com/watch?v=HJZLVkKbTDc

I will share some code once im happy with it, but though you might like to see the combination all working together
Last edited by mattius on Sat Jan 02, 2016 10:56 pm, edited 1 time in total.

achurch0607
Posts: 3
Joined: Thu May 08, 2014 12:07 am

Re: Thought id share: Wedding Photo Booth

Thu May 08, 2014 12:10 am

Very Cool. I am working on something similar and I really like the way you did the countdown. I think you said you are using pygame to make countdown timer. Any help getting the pygame window to overlay on the picamera would be great. I am new to pygame and am struggling to get it working with the picamera module.

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Thu May 15, 2014 10:32 pm

Apologies,

I only just noticed the reply, i messed around with doing a proper overlay however it slowed down the live preview of the cam, so i didn't like it, there is a post on here somewhere i followed to do that.

What i have is a trick really, its nice and simple and works, its a black pygame full screen with the numbers/text drawn on it. Then i messed with the transparency of the camera preview so you can see it through it, the trick you have to watch out for is the black background will darken the preview more than the output image will show so you have to mess around with the brightness of it.

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Tue May 20, 2014 6:49 am

Very nice!
I'm working on a similar project utilising the canon selphy cp-910. but how did you manage to get this one to work. Because CUPS doesn't list this printer. Any suggestion on how to install it on the raspbian would be great because I struggle to work that out on my own currently.
Do you think you can post some code? Cause what you did is pretty much perfect!
Cheers Ben

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Wed May 21, 2014 1:36 am

I'm using the cp750 driver in cups. Try the various selphy drivers people have success with different ones, I'm using a cp910 so it is possible.

I'm not 100% happy with the code yet to share, if your stuck with anything I.can help though

themusicdan
Posts: 1
Joined: Wed May 21, 2014 3:43 am

Re: Thought id share: Wedding Photo Booth

Wed May 21, 2014 4:07 am

I'm working on a similar project, partly inspired by some of your earlier videos, and thought I'd share a couple things that I found improved my code, in case you want to incorporate them into your project. I actually happen to be using exactly the same hardware as you by some coincidence, with a 5" screen, a picamera, and a CP910 printer. Here's an image of mine (It will be mounted in a PVC booth that I'm still building):
2014-05-20.jpg
2014-05-20.jpg (48.03 KiB) Viewed 32662 times
To fix the issue with the resolution of the preview not being the same as the captured image, I set the following:

Code: Select all

camera.resolution = (1944, 2592)
camera.framerate = (15)
Note: this settings change will make the preview slightly more choppy, and the preview is still at a slightly different brightness than the captured image, but it is much nicer to show the same field of view during preview as it does during capture.

A quick question for you: Have you had any issues with the printer kind of stalling out? If I have to replace the ink cartridge, it sometimes "loses" a print job and stalls. I have to restart the "booth" for it to break out of the stall, and then it still loses the print job. Let me know if you have any advice.

johnboy
Posts: 2
Joined: Sun May 25, 2014 5:59 pm

Re: Thought id share: Wedding Photo Booth

Sun May 25, 2014 6:04 pm

I have been trying to do this with the SELPHY C910 but the print doesn't print the image. I have tried the CP790 and CP750 in CUPS but with no luck. I get the error
Cannot read date from memory card!
Cannot print incompatible images or memory card not readable
It seems cups on the PI comes with gutenprint 5.2.9 but there is now a gutenprint 5.2.10 which lists the CP900 as a supported printer. Tried downloading it and installing it but the new driver doesn't get listed in the options for CUPS, anyone managed to update this or have any other advice on how to get the SELPHY to print images, I am using the cups python package and printFile() sending a jpeg image (does resolution matter?)

johnboy
Posts: 2
Joined: Sun May 25, 2014 5:59 pm

Re: Thought id share: Wedding Photo Booth

Mon May 26, 2014 10:11 am

Finally got the gutenprint 5.2.10 working with cups. But even selecting the SELPHY CP900 drivers it refuses to print.

I switched to USB rather than over the wireless network and the images now print :)

It is however quite slow from the point at which python tells cups to print and the time that the printer actually starts printing out the image. Not sure if this is CUPS or the printer itself, but in the OP's video the delay was a lot lot shorter (mine is taking maybe 3 or 4 minutes)

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Sun Jun 01, 2014 10:43 pm

Dan, my issue with the resolutions was fixed by updating to the new firmware which gives full frame preview.
I've not encountered your selphy problem but I do have an occasional issue of the selphy printing a blue image now and again kinda like the color rollers get stuck. To combat this I wired in another button which does a reprint of the last image.

John, i played around a lot to get it to print faster over USB, firstly make sure your sending the image from the raspberry storage not a USB, i save the final image to a tmp directory on the pi before sending it to the printer, secondly the size of your image matters the transfer to the selphy is slow as so I try and keep the image I send to it under 300kb by resizing it in python, i still save full size to USB.
My time from starting to send to print is now around 60 secs which is almost barnacle.

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Sun Jun 29, 2014 8:02 pm

So yesterday the creation had its very first wedding,

Apart from a few little niggles (forgot to include a button to reenable cups when the printer runs out of ink)

It was a stunning success, there was over 400 photos taken on it on the day! Very happy with the design now.

Que version 1.1 which will have a few tweaks for the next wedding,

Heres an example of the pics it took...
10516762_10152161211636003_6158311189199864410_n.jpg
10516762_10152161211636003_6158311189199864410_n.jpg (60.35 KiB) Viewed 31892 times

liquorbarn
Posts: 5
Joined: Wed Jul 09, 2014 12:46 am

Re: Thought id share: Wedding Photo Booth

Wed Jul 09, 2014 1:33 am

Do you have any updates on this?

I thought i might try my hand at making a photobooth for my sisters wedding.. however.. seeing as i am relatively new to programming. and this is my first raspberry pi project, I am having all sorts of trouble..

Specifically with...

putting the photos together after they have been saved
and using the display to show a count down.

Havn't gotten to the printer portion yet so who knows about that.

whats the saying? up a creek without a paddle? or down a creek without a paddle? whatever it is.. i have no paddle.. also i think i might be sinking...

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Wed Jul 09, 2014 7:30 pm

Sounds like you are quite far from the end,

Here's a snippet of code which shows how i join all the images together..

Code: Select all

                        #Capture the image from Python camera
                        camera.capture(os.path.join(imagefolder,filename))
                        #create a Python image library object from the image captured
                        im4 = PIL.Image.open(os.path.join(imagefolder,filename))
                        #Load your default template mine is a 1200 x 1800 pixel image otherwise you will have to change sizes below.
                        #Same was done for the other 3 image objects im, im2 and im3
                        bgimage = PIL.Image.open("/home/pi/Desktop/template.jpg")
                        # Thumbnail the images to make small images to paste onto the template
                        im.thumbnail((1120,800))
                        im2.thumbnail((1120,800))
                        im3.thumbnail((1120,800))
			im4.thumbnail((1120,800))
                        # Paste the images in order, 2 copies of the same image in my case, 2 columns (2 strips of images per 6x4)
                        bgimage.paste(im,(15,120))
                        bgimage.paste(im2,(15,900))
                        bgimage.paste(im3,(15,1700))
			bgimage.paste(im4,(15,2600))
                        bgimage.paste(im,(1235,120))
                        bgimage.paste(im2,(1235,900))
                        bgimage.paste(im3,(1235,1700))
			bgimage.paste(im4,(1235,2600))
                        #Save the final image
                        bgimage.save(os.path.join(imagefolder,"Final_"+`imagecounter`+".jpg"))
You will need to work your coding to fit, but the above was the hardest bit i came across, so i thought id give you it to help you out.

With regards to displaying a countdown, read up on Pygame, create a black full screen background and blit bright numbers onto it, when you create your camera object turn on camera preview and play around with preview_alpha so that it is transparent enough for the numbers to show through.

Your biggest nightmare will be printing as many have found out, connecting CUPS to the photo printers can be a challenge and seems different for everyone.

That should give you a head start.

liquorbarn
Posts: 5
Joined: Wed Jul 09, 2014 12:46 am

Re: Thought id share: Wedding Photo Booth

Wed Jul 09, 2014 8:02 pm

That looks awesome!

Thanks! I'll let you know if i can get it going!

liquorbarn
Posts: 5
Joined: Wed Jul 09, 2014 12:46 am

Re: Thought id share: Wedding Photo Booth

Mon Jul 21, 2014 3:01 pm

Thanks for the help on the assembly of the images. it worked great!

Like you predicted i am having most of my issues with printing right now.

i have successfully installed cups. and i have printed out a final saved photobooth strip from terminal, but everytime i try and write in code, i either get an error saying i have no access to the file or i am unable to print..

am i missing something obvious?
this is my first time coding in python...

also did you have any trouble with the picture not actually being borderless? and printing out with a white border?

also i am using a canon selphy 910..

any help or suggestions would be awesome as i now have officially 3 days of coding left.. while working.

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Mon Jul 21, 2014 9:48 pm

I have never managed to get the CP910 to print truely borderless on either the PI or PC or memory card.

I trust you are using Pycups in Python to print?

https://pypi.python.org/pypi/pycups/1.9.58

If you can print a photo from the PI you've done the hard bit, getting the drivers working. Its simply just:

Code: Select all


import cups
>>> conn = cups.Connection ()
>>> printers = conn.getPrinters ()
>>> printer_name = printers.keys()[0]
>>> conn.printFile(printer_name, filename,"TITLE",{})
You can change Title to anything you want. Filename is the file you want to print, remember and use the full path!

You probably don't have time to have any error handling for when the printer runs out of ink or paper. neither did i.

It will freeze and stop printing when it runs out as CUPS detects a problem and disables the printer.

I found a simple solution on the night, in the init.d when booting i run the command CUPSENABLE printername
obv change the printername to what CUPS calls your printer.

That way when you turn the pi off and on again it will restart the print queue.

Alternatively have a button then sends that command to the OS.

Ideally you check see if it printed ok if not send a message, however mine was that busy while it was trying to print another set of photos were getting taken.

liquorbarn
Posts: 5
Joined: Wed Jul 09, 2014 12:46 am

Re: Thought id share: Wedding Photo Booth

Thu Jul 24, 2014 1:38 pm

You are helping me so much with this thank you. Everything seems to be working okay now except for a couple issues? i am having i guess...

when you say:

"in the init.d when booting i run the command CUPSENABLE printername
obv change the printername to what CUPS calls your printer."

im not entirely sure what that means..
is init.d a file i just need to edit?
or is it during actual boot up??

I keep getting a screen saver when it is left untouched and i don't think i want one..
also i keep having a mouse on my screen during operation and don't want one..
(i have looked up both these on other forums/boards but i can't seem to find a workable solution..)

Thanks again, i'll put up some pictures of the finished product if anyone wants to see.

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Thu Jul 24, 2014 5:12 pm

Disable screensaver
http://raspberrypi.stackexchange.com/qu ... oing-blank

Mouse
http://www.pygame.org/docs/ref/mouse.ht ... et_visible

Google is your friend!

init.d is a file which runs on startup, you can add commands to it to run them at startup, again google it.

Cupsenable enables the print buffer, when the printer runs out of ink or paper for any length of time Cups disables the print queue, without a keyboard or a way to access the web front end you cannot enable it again.

So for a completely hands free solution put Cupsenable Canon_CP910 (or whatever it is) in the init.d that way if the buffer disables, you can just power off and on to restart it. Alternatively put a button which calls this command when pressed.

Ideally you handle the error but i don't think you have time.

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Thu Jul 31, 2014 7:54 pm

Whoohoo runner up in the Raspberry PI Photo Awards

User avatar
Douglas6
Posts: 5208
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, USA

Re: Thought id share: Wedding Photo Booth

Thu Jul 31, 2014 8:39 pm

Congratulations! Looks the competition was pretty strong; some excellent pics here: https://www.adafruit.com/galleries/winn ... test-2014/

MrChristo
Posts: 4
Joined: Fri Sep 12, 2014 7:45 am

Re: Thought id share: Wedding Photo Booth

Sat Sep 13, 2014 5:13 pm

Great work and congrats.

Any chance you can give us the complet code ?
You would help so much !

driesvro
Posts: 1
Joined: Wed Sep 17, 2014 9:38 am

Re: Thought id share: Wedding Photo Booth

Wed Sep 17, 2014 9:54 am

Very nice project.Congratulations with your results.
I'm also working on a similar project for my wedding.
Can you share the complete code? I mean, connection with pi camera, counter, save picture and connection with printer. Which file system do you use?
I'm a beginner in programming python code, some scripts and want to learn a lot of your code.
Thanks a lot.

leftyfb
Posts: 1
Joined: Sat Oct 11, 2014 9:21 pm

Re: Thought id share: Wedding Photo Booth

Sat Oct 11, 2014 9:26 pm

@mattius

Code: Select all

I will share some code once im happy with it, but though you might like to see the combination all working together
Do you think you could share the complete set of code for this project? Even if you're not happy with it's current state, it might be perfect for others as is.

Thanks,

leftyfb

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 12, 2014 11:26 am

Im still working on my code, we are looking into the possibilities of starting a business model based on this so consequently the code will not be released in its entirety.

There are more than enough snippets on this thread to enable anyone to do the same thing with a wee bit of googling for various code libraries.

It will never be a one size fits all code, and im more than willing to give people pointers.

Come on try some coding yourselves guys...

MrChristo
Posts: 4
Joined: Fri Sep 12, 2014 7:45 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 12, 2014 12:19 pm

Mattius, i have a similar code than yours and after seeing your video I have the same problem than yours.
The preview of the picamera shows a smaller view of the photo taken with the capture funciton, did you found how to manage that ? I guess it's a ratio of resolution problem..

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 12, 2014 4:11 pm

I don't have that problem anymore, a new firmware was released for the camera 6 months ago which allows full frame preview, do a firmware update you will be able to do fullframe preview

Return to “Graphics, sound and multimedia”