George timmermans
  • About Me
    • Resume
    • Press releases
  • Blog
  • Projects
    • Long Range WiFi Link
    • Embedded Systems >
      • Photo Booth
      • Classroom VU meter
      • USB Media Controller
      • Weather Station
      • Arduino Swimming Pool Controller
      • GRBL Android Controller
      • Arduino Serial Driver
      • Arduino Multitasking
      • 8x8x8 LED Cube
      • Analog -> Digital Geiger Counter
    • 3D Printing >
      • Simplify3d Configuration
      • 3D print repairs
    • Home Brewing >
      • Mead Recipes >
        • Cinnamon Mead
        • Sweet Chili Mead
        • Lemon & Ginger Mead
        • Mead Liqueur
        • Honey Beer
      • Glühwein (Spiced Wine)
      • Limoncello
    • House
    • Toolmaking
    • Laser Cutting
  • Weather Cam
  • Contact

Photo Booth Software

6/11/2016

7 Comments

 
After finishing wiring all the components in the new enclosure (see updated post below) I decided to make some changes to the software. First step was to load it in a proper IDE with code inspection. And what a shocker that was. It was full off incorrect indentations (which are very important with python), unnecessary semi colons and some minor stuff like incorrect commenting.

So after fixing as many errors and warnings as I could it was time to strip out the upload to Tumblr and gif generation code. Luckily parameters where named in a way that makes sense. The code is pretty easy to read and removing the unwanted bits was pretty straight forward.

The end result is a nice clean program with no unwanted functionality. Hopefully this proves to be a more stable program too but time will tell. The modified program is attached at the bottom of this post. My next experiment was saving the photos onto USB drive. 

Although it's pretty straight forward saving to USB drive I discovered that removing the USB without corrupting it is very tricky. Therefor I think I prefer to store the photos locally on the microSD card and copy to another device after the event. That should reduce the risk of corrupting all the photos by not properly removing the USB device. Also a power failure might corrupt the USB device.  

Update: There are two little tweaks to be made to the pi OS.
1. I get a low voltage warning now and then. This can be disabled by adding the line:
'avoid_warnings=1' to /boot/config.txt
2. Disable the screensaver. go to /etc/lightdm/lightdm.conf file and add in the [SeatDefaults] section the following command:
xserver-command=X -s 0 -dpms
photobooth.7z
File Size: 151 kb
File Type: 7z
Download File

7 Comments
Daniel Kürsten
23/4/2017 08:28:58 am

Hi George,

I like your photo booth verry much and I am trying to build my own with your modified software.
I am using a 17" LCD panel with resolution 1920x1200.
Everything is working fine, but I have one problem.
The preview is much smaller than the taken pictures. I already changed the resolution in the config file to the display resolution, but it does not change anything to the preview size. Can you please help me.

Kind regards
Daniel

Reply
George
23/4/2017 08:50:50 am

Hello and thank you. As part of the zipped project file you will find a file names 'config.py. In that file you will have to declare your monitor resolution for your Photo Booth. I assume you already configured the display driver for your Pi in /boot/config.txt.

Cheers,
George

Reply
Daniel Kürsten
23/4/2017 09:03:23 am

Hi George,
Thank you for your fast reply.
As mentioned I aready changed the resolution in the config.py.
I am using the desktop version "pixel" of the raspberry pi OS.
Do I also have to configure the display driver in the config.txt?

George
23/4/2017 09:19:49 am

It wouldn't hurt checking the display driver. You should find something in /boot/config.txt along the lines of:
# uncomment to force a specific HDMI mode (here we are forcing 1920x1200!)
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=1920 1200 60 6 0 0 0

max_usb_current=1

And you can play around with the camera resolution on line 35 and 36 in 'drumminhands_photobooth.py'.

Reply
Daniel Kürsten
23/4/2017 09:32:42 am

Thank you very much for your advice. I already changed the camera resolution to the maximum of version 2 which I am using. I will try to change the config.txt 👍

Daniel Kürsten
25/4/2017 07:07:02 am

I tried serveral display settings, but it is always the same. The preview has a smaller view as the taken picture.
Please see my test video.

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

I also tried to change the code in this line:

camera.start_preview(resolution=(config.monitor_w, config.monitor_h))

with a fix resolution of (1920, 1200) but it does not change anything. It looks like there is a zoom in the preview.

I am using raspberry pi 3 with camera v2

Daniel Kürsten
26/4/2017 07:52:43 am

I found out what's the problem.

In preview mode the camera is using only the video part of the sensor, so the picture is cropped. When a still photo is captured, the whole sensor is used.
The only posibilty to fix this problem is to capture the photo with "use_video_port=True". I tried to configure this but every time the script stops when saving the picture.
I tried to change the code to the following:

camera.capture(filename,use_video_port=True,)

Perhaps you can tell me what is my problem and how to fix it.

Reply

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    George Timmermans, Research Toolmaker, Software Engineer and Tinkerer

    View my profile on LinkedIn

    Archives

    January 2021
    November 2020
    July 2020
    May 2020
    November 2019
    August 2019
    January 2019
    October 2018
    January 2018
    November 2017
    October 2017
    August 2017
    June 2017
    May 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015

    Categories

    All
    3d Printing
    Photobooth
    Wisp

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • About Me
    • Resume
    • Press releases
  • Blog
  • Projects
    • Long Range WiFi Link
    • Embedded Systems >
      • Photo Booth
      • Classroom VU meter
      • USB Media Controller
      • Weather Station
      • Arduino Swimming Pool Controller
      • GRBL Android Controller
      • Arduino Serial Driver
      • Arduino Multitasking
      • 8x8x8 LED Cube
      • Analog -> Digital Geiger Counter
    • 3D Printing >
      • Simplify3d Configuration
      • 3D print repairs
    • Home Brewing >
      • Mead Recipes >
        • Cinnamon Mead
        • Sweet Chili Mead
        • Lemon & Ginger Mead
        • Mead Liqueur
        • Honey Beer
      • Glühwein (Spiced Wine)
      • Limoncello
    • House
    • Toolmaking
    • Laser Cutting
  • Weather Cam
  • Contact