PDA

View Full Version : Webcam photo booth light control



BoothThis
October 31st, 2011, 05:12 AM
I'm playing with a possible permanent install using Webcam Photobooth. I would be using a 15 touch screen with a purpose built PC (win 7, 4 gb ram, 1tb hard drive), a up-dr200 printer and a Logitech C910. In the spirit of this install, I need to be as green as possible. I have been playing with interior booth lighting that turns on via motion detection sensor and turns off again after 5 minutes of no motion. This would be 2 - T6 florecent lights built into a soft box. This does not have to be run through the computer, but I may using an x10. I will also be using an eport g8 to interface credit cards. As for photography lighting using the webcam, I would like to be able to activate 2 or more higher power led lights that are built into the soft box as well. For this I was planning on using the PhidgetInterfaceKit 0/0/4: http://www.phidgets.com/products.php?category=9&product_id=1014 Has anybody used this in a breeze powered booth? I seam to recall that photobooth has some scripts that use it to turn on and off lights. This would add great functionality to the strip sequence if I could get the lights to activate when the picture is being taken or during the whole series.

Chris, have you been asked about this type of device. Programming is not my gig, but I sure could use this functionality if I get this job.

jfreeman1412
October 31st, 2011, 05:36 AM
I am interested in how this works for you, I had asked about the credit card swiper a few months back and was told that no one was using them. Let me know how that works for you and how you plan on interfacing that, as I am sure you will have to use a script.

Chris Breeze
October 31st, 2011, 01:17 PM
I've been experimenting with the Phidgets 1014 relay board and plan to write a short article on how to use it to turn lights on and off. I've written a small utility for controlling the relay and some simple AutoHotKey scripts to turn the relays on and off when different screens are displayed. The idea was to turn the lamps in illuminated buttons on and off but there's no reason you why you can't control the main lights this way provided you don't exceed the voltage and current ratings of the relays.

neilneilb
October 31st, 2011, 01:42 PM
This is what I use. http://www.pwrusb.com/products.html This comes with software and several different options for turning outlets on and off including global hot keys which do not interfere with photobooth software and can easily be controlled with simple auto hot key scripts.

BoothThis
October 31st, 2011, 05:39 PM
Thanks Chris,

Do you happen to have any time table for this. My project is due to complete in 40 days. I could kludge it together and make something like the usb power strip work temporarily.

Neil, Do you have any HotKey scripts that you would be willing to share?

JFreeman, 2 companies make interface that I know will work for the photo booth, both are wireless/sim card based. The one I have been using in a customer of mine's Oxygen/Internet kiosk is called coinfree. They work, but cost $30 month, plus fees and the customer service leaves something to be desired. I have 3 of the units that will probably be up for sale by the end of the month.

The other unit is called eport. There are 2 models.1: eport edge is a sim based credit ca5rd swipe in a small stand alone package. 2: eport g8 is a ethernet wired or sim based credit card processing unit that is 2 pieces. I'm leaning toward the g8 due to "wireless/cell" connectiuvity with Ethernet as a backup for locations in my area that do not get decent cell signal. Apparently they come in both gsm and cdma flavors.

The unit can emit a pulse signal just like a bill acceptor, thus activating the photo booth sequence or auto hot key script that then lets the user self start the sequence. Chris has a better understanding of this, as I have not gotten that far yet. (and I suck at AHK)

stillmation
November 1st, 2011, 09:18 AM
interesting thread, will be watching this too.

This is a board that I have my eyes on for button, photo chute, etc illumination:
http://www.gremlinsolutions.co.uk/products/leddriverboard.htm

I'm also working up to using the webcams but need to trigger some lighting. I've experimented with high power LED strips and LED video lights, both seem to be a viable option for a full time install.

Chris Breeze
December 2nd, 2011, 06:47 PM
I haven't had time to write a web page describing this yet, but here is a sample AutoHotKey script and drivers for both the Phidgets PhidgetInterfaceKit 1014 0/0/4 relay board and the Pac LED driver board from Gremlin Solutions (UK) or Ultimarc (US):
http://www.breezesys.com/downloads/photobooth_lights_20111202.zip
The script will work with DSLR Remote Pro for Windows, NKRemote, PSRemote or Webcam Photobooth.

The Phidgets PhidgetInterfaceKit 1014 0/0/4 relay board is available from:
http://www.phidgets.com

The PAC LED driver board is available from Gremlin Solutions in the UK:
http://www.gremlinsolutions.co.uk/products/leddriverboard.htm
or from Ultimarc in the US:
http://www.ultimarc.com/pacdrive.html

stillmation
December 3rd, 2011, 01:00 AM
Brilliant, going to try this out. Thanks Chris.

BoothThis
December 24th, 2011, 11:33 PM
As usual, I am late to the party.

Thanks for the script Chris. I don't know which interface to use quite yet. I have also been trying to get a hold of Shariq from PowerUSB (http://www.pwrusb.com/powerUSB-digitaI0.html) as I think his USB controlled power strip would fit the bill. Still more playing to be done.

Update on USA Tech eport (US only). I found out that USA Tech no longer has a hardwired version of the device, which is a bummer in some respects as I would prefer to use a standard network (802.X) in some places. Apparently they have dropped ATT in favor of Verizon. The original Verizon units would not link up and I went through 9 of them before finding 4 that worked. Tech support has been helpful and has been accommodating to our needs. The interface is really simple as the eport can put out a pulse that can be recognized though breeze software the same way that a coin acceptor is. The device is a little bulky in that it sticks off the front of the booth a good 1.5 in (4.5cm). They do have a high gain antenna for use in spotty areas.

Chris Breeze
January 3rd, 2012, 03:41 PM
I've added an article to the website on how to control lights using a Phidgets relay board or I-PAC LED driver board and an AutoHotKey script. You can read the article here:
http://www.breezesys.com/articles/photobooth_lights.htm

BoothThis
January 3rd, 2012, 08:24 PM
Thanks again Chris.

My ipac and another uhid nano should be here today and I am in line waiting for a new shipment of phigets to arrive. Just talked to Shariq from pwrusb.com. Digital I/O strips are ready to be shipped. He has not updated his webpage (yet), but should have it done by the end of the week. Again, thanks and I will let you know how the development goes.

photo_ells
February 16th, 2012, 02:58 PM
Hi Chris I have just bought a Phidget board from a UK supplier and installed the drivers and using the PH control panel I can get the relays to open and close no problem.

When trying to run the sample ahk script you provided for lights I get an error message stating that the PhidgetRelay.exe failed to start because it's side-by-side configuration is incorrect. I get this when trying to launch the AHK or when trying to just run the PhidgetRelay.exe on it's own.

I have just updated the C++ redistributable package and also the .net framework as recommended by googling the error but neither of them has got it working! Have you any ideas?

I am wanting to use the relay to turn on and off a piece of kit via the touchscreen by adding (hopefully) some script to the current options screen I use with a couple of extra GUI buttons on it to accomplish this. I have a rough idea of how to implement the code by borrowing it from the lights ahk. At the moment it's just an experiment to see if it will work before i introduce it to the booth for real. But unless I can get PhidgetRelay.exe running I am at a lost and can't try out any AHK changes I make.

Thanks

Elliott

Chris Breeze
February 17th, 2012, 09:52 AM
I've rebuilt PhidgetRelay.exe using different settings to remove the dependency on the VC++ libraries which should fix the problem. Please try downloading it again:
http://www.breezesys.com/downloads/photobooth_lights.zip

photo_ells
February 17th, 2012, 10:47 AM
Thanks Chris, new PhidgetRelay.exe works perfectly and just tested my new AHK script and that seems to be working well too turning the relay on or off via the touch screen.

Thanks again

Elliott

photo_ells
February 20th, 2012, 04:59 PM
Hi Chris and any one else that can help

I have in a previous post in this thread explained that I am editing the options AHK to add a GUI "button" to the touch screen to turn on a relay on the phidget interface board for a small wind machine fan and I have managed to get this working just fine with a reset script in the processing AHK that then turns the fan off automatically at the end of the session.

Well my mind has been ticking away and I was thinking what else I could do with the relay and thought about adding a diffused ring light around the camera lens (using an angel eyes headlight 12V type of thing) that only comes on when the taking.jpg is displayed and then turns off again when the picture has been taken (in the hope that the users will be a bit like mosquitos and attracted to the light and look at the lens rather than the screen).

I edited the lights AHK script for this and it did turn the lights on and off as expected but it also turned off the relay #1 (the fan) when it kicked in due to the reset relays at the start of the script. I tried to edit the reset relays out and then the lights wouldn't come on so I combined the lights script with the options script and got it working-ish.

It works just fine for one scenario but not the other…

Here's what currently happens

Scenario 1 — User wants wind and presses wind button on TS
Relay #1 switches on turning fan on
Taking screen appears in the sequence and ring light comes on (controlled by relay #2), taking screen goes away ring light turns off (this repeats for all four shots)
Processing screen appears and is replaced by processing AHK which has an overlay and turns the fan off.
Options screen appears again ready for next user

Scenario 2 — User doesn't want wind and doesn't press button on TS
Relay #1 remains off
Taking screen appears in the sequence and ring light comes on (controlled by relay #2), taking screen goes away ring light turns off (this repeats for all four shots)
At the same time as the ring light (relay #2) comes on for the first time so does relay #1 the fan and remains on for the rest of the session.
Processing screen appears and is replaced by processing AHK which has an overlay and turns the fan off.
Options screen appears again ready for next user

In Scenario number two the fan should never come on just the ring light.

I have had a look at the code and can see where the fan is coming on but can't see why as I thought that it should only come on when the picture with the gLabel gProfile3Clicked is pressed. For some reason the script is allowing it to come on during the taking screen even though it's not pressed.

I know nothing about AHK just kind off mashed it together based on the other scripts so not sure what I need to change to make the gProfile3Clicked only for when the ready screen is showing to prevent it turning on.

The code I have is below, any suggestions as to what I need to do will be much appreciated, anyone that wants the code (when it works or the fan TS only code) please feel free to use :)


; Use this for Phidget relay board
RelayExe = PhidgetRelay.exe


#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

ResetRelays()

; set this to 1 to hide the cursor when the options screen is displayed
;HideCursor = 1

; define the options screen
Gui, Color, 0
Gui, -Caption -Border +AlwaysOnTop
Gui, Add, Picture,center,C:\Program Files (x86)\BreezeSys\PSRemote\PhotoboothImages\windscre ens\options.jpg
Gui, Add, Picture,x245 y542 gProfile1Clicked,C:\Program Files (x86)\BreezeSys\PSRemote\PhotoboothImages\windscre ens\optionscolour.jpg
Gui, Add, Picture,x567 y542 gProfile2Clicked,C:\Program Files (x86)\BreezeSys\PSRemote\PhotoboothImages\windscre ens\optionsbw.jpg
Gui, Add, Picture,x206 y139 gProfile3Clicked,C:\Program Files (x86)\BreezeSys\PSRemote\PhotoboothImages\windscre ens\windbutton.jpg


; loop forever monitoring the status of the photobooth screen
Ready = 0 ; 0 tells script to display options screen if ready.jpg screen is displayed
Loop
{
IfWinExist, Breeze Systems Photobooth
{
WinGetTitle, Title, Breeze Systems Photobooth
if Title contains ready.jpg
{
if Ready = 0
{
Ready = 1
ShowOverlayWindow()

}
}
else if Title contains processing.jpg
{
Ready = 0 ; start looking for ready.jpg screen
}



else if Title contains taking.jpg
{
if PreviousTitle not contains taking.jpg
{
RelayOn(2) ; taking screen has just been displayed - turn relay #2 on
}
}
else if PreviousTitle contains taking.jpg
{
RelayOff(2) ; taking screen has just been removed - turn relay #2 off
}


PreviousTitle := Title
}

else
{
Ready = 0
}
Sleep 100 ; sleep for 1/10th sec to avoid hogging the processor
}
Return

GuiEscape:
HideOverlayWindow(0)
return

; Ctlr+Q shows the options screen if ready.jpg is being displayed
^q::
Ready = 0
return



; Send Ctrl+c to photobooth to select colour and then hide the options screen
Profile1Clicked:
WinActivate, Breeze Systems Photobooth
Send ^c
HideOverlayWindow(250) ; give the photobooth time to switch profiles before hiding the options screen
return

; Send Ctrl+b to photobooth to select b/w and then hide the options screen
Profile2Clicked:
WinActivate, Breeze Systems Photobooth
Send ^b
HideOverlayWindow(250) ; give the photobooth time to switch profiles before hiding the options screen
return

;turn on fan
Profile3Clicked:
RelayOn(1)


; show the overlay window and optionally hide the mouse cursor
ShowOverlayWindow()
{
global HideCursor
Gui, Show, Maximize
if HideCursor > 0
{
Run, nomousy.exe /hide
}
}

; hide the overlay window with optional delay
HideOverlayWindow(delay)
{
global HideCursor
WinActivate, Breeze Systems Photobooth
if delay > 0
{
Sleep delay
}
Gui, Hide
if HideCursor > 0
{
Run, nomousy.exe
}
}

; Turn individual relay on
RelayOn(channel)
{
global RelayStatus, RelayExe
RelayStatus |= (1 run %RelayExe% %RelayStatus%,,Hide
}

; Turn individual relay off
RelayOff(channel)
{
global RelayStatus, RelayExe
RelayStatus &= ~(1 run %RelayExe% %RelayStatus%,,Hide
}

; Turn all relays off
ResetRelays()
{
global RelayStatus, RelayExe
RelayStatus = 0
run %RelayExe% %RelayStatus%,,Hide
}