photo booth update

We've got the hardware mostly built, and I believed the software to be done, until we actually tried it out in the club and discovered that, yes, the iSight camera is a piece of shit. It's terrible in low light where "low" means "less bright than the surface of the sun". It's so bad that even using a spotlight in the booth won't help, because it would have to be so bright that it would illuminate the whole room. And possibly cause skin cancer.

So one option is to get a Firewire DV camcorder that is good in low light and use that. But I don't know which, and I don't have one, and I don't know if that'd be good enough in low light either. (I'm guessing "probably not": even those Sony Nightshots we use for the webcast cameras aren't exactly "photo quality" in the dark.)

The other option is to use a digital still camera with a flash, which is what Photoboof uses (running on Windows). The trick there is that you want the photo camera to behave like a video camera by giving you frames continuously, and only fire the flash when requested.

We've got this groundscore Canon PowerShot S30 that we were thinking of using, and when you use Canon's RemoteCapture software, it does exactly what we need: it shows live video (at maybe 10FPS), and when you click, saves a flash picture, all without a CF card being involved.

But, we can't just use RemoteCapture, because it's a hairy UI (not "kiosk-y" at all), and it's not AppleScriptable. Still, it shows that this camera hardware is at least capable of doing what we need...

netik fought with gphoto2 for a while, and found that it can fire the camera and get the picture out, but it can't do video. Me, I can't even get gphoto2 to build on my iMac. DarwinPorts has libgphoto2, but it's two years old, and apparently the oldest gphoto2 that is still available doesn't work with that verion of the library. Or something. I have an instinctual aversion to this software anyway; it has the Linux Stink on it in a big way.

So then I thought I'd try doing it by hand with libptp, and just hack out the raw commands to the camera that way. But, on MacOS, that just dumps core at startup. I patched around that, but now I can't make any sense out of the data coming out of libusb. Like, you get this list of USB busses and those have a list of devices on them (sensible enough). But the numbers in these device structures -- vendor ID, product ID, etc. -- have no correlation to the vendor and product IDs that are printed by System Profiler! The camera shows up in System Profiler, but when I'm looking at the data structures in ptpcam.c, I can't even figure out which of the device structs represents the camera. Let alone why it passes it by as if it's not a camera at all.

This is BS. There's got to be an easier way.

(Before you suggest it: using two cameras, one for video and one for stills, is a stupid idea that would work terribly.)

Tags: , , , ,

39 Responses:

  1. strangedave says:

    Would AppleScripting RemoteCapture using Prefab softwares UI browser be a possible solution?

    • netik says:

      Unfortunately, RemoteCapture doesn't export any applescript dictionaries we can use.

      • strangedave says:

        Thats why I suggested the Prefab software product - its specifically designed for AppleScripting apps that don't have Applescript dictionaries, via GUI scripting. It might be a bit clumsy, depending on how much you'd have to talk to RemoteCapture, but its doable.

  2. Could you at least remove the lighting issue by letting the person control it? Give them a couple of spots with dimmer switches and let them choose it? You might get a whole other angle in weirdly lit camera fun.

  3. kallisti says:

    Here's an article on how to modify a webcam to use infra-red light, and it says use IR LEDs to illuminate the subject...also has the plus of giving funky colours too!

    As for capturing video...I'm not a real mac guru, so I don't know how hard it would be to do, but sometime like xawtv under linux gives you both video and still capture code, I don't if there is anything equiv for the mac to Video4Linux API.

    Here's another IR project:

    I guess that just about any CCD camera can be modified to use IR...


    • baconmonkey says:

      most CCds will pick up IR. point a TV remote at a camera, push some buttons, and you'll usually see the IR diode glow a blue-white.

      Actually, it might be worth seeing if a remote control held at really close range will illuminate a subject at all, and if it does, buy a bunch of IR LEDs and have them light the subject.

    • IME you need to remove the little IR filter in the webcam to have it work in IR. And some things (especially clothes with certain dyes) may come out funny colours (that could be a feature though, and it'd be acceptable for video "preview" mode). The idea of using a shitty webcam and firing an external flash sounds good to me, though it does mean more flakey hardware.

    • jwz says:

      IR pictures look stupid. It's a cute gimick the first time you see it, and that's all.

      • enochsmiles says:

        I agree that pure IR pictures would be gimicky, and not the best thing for you. But I've had luck using IR to augment a flash or other visible-spectrum lighting when using camcorders, so that you get additional brightness without too much of the IR appearance. If all else fails, that might be worth a shot.

        I'd also suggest asking ioerror for tips; he dragged me to a Halloween party that some friends of his were throwing, and they had a photobooth set up much like you're describing. (I seem to recall the trick was an external flash, but I'm not 100% sure.)

  4. brokengoose says:

    The "Image Capture" app that's built in to OS X is supposed to be very scriptable. I suspect that it just says "take a picture" to the remote device without anything so helpful as a preview, though.

    It gives me an idea for a dumb hack, though: What if you captured an image every second and then, when the user says "ready", you fire an external flash as you take the next image?

    Or, since you already have the iSight set up, grab stills from that feed, fire a flash, and look for the change in light levels. That takes timing out of the problem. A crefully chosen spot in the background (the top left corner, for example) with a known brightness would eliminate the need for intelligent image processing.

    • glenra says:

      The "Image Capture" app on the iMac uses a flash (with the built-in camera) to capture a decent low-light picture. What it does is turn the display on full white for a split second while it takes the picture.

  5. baconmonkey says:

    Actually, how hard would it be to make the computer trigger an external flash, then synch the capture using the isight to that flash?
    John loves building crazy hardware like serial port triggers.

    I tried looking to see if anyone has a USB controlled camera flash, and gave up trying to search around all the USB flash memory devices.

    • wire_on_fire says:

      synch could be tricky. Flash is often 1/8000th of a second, so you'd have to monkey with the timings to make sure the flash fired at the exact moment that the shutter was open.

      Otherwise, easy. There are two connections on the hotshoe. Connect them and the flash fires. Just be careful, because old flashes would let quite a lot of current flow (500v sometimes) through that connection.

    • jwz says:

      It's a video camera, fire a flash and it'll just bloom. AGC takes a while; and if you turn it off, then you get to pick between "picture" and "no picture".

      • baconmonkey says:

        you could still test that, and partly cover the flash. just do a raw video capture of the isight on the booth, and fire off a flash. a quick skim of the video would show how close to viable it might be. When I've shot live shows, and people have taken flash photos, the gain hasn't been too much of a problem, but the white balance tended to be a bit off.

  6. Most digicams fail miserably in low light-- but the Fuji F30 is the exception, famous for actually being able to get good indoor shots. It even has a lamp for autofocus in very low light (like, in a bar). Camera + xD memory card about $300.

    • dojothemouse says:

      Any camera that uses their "super CCD" is pretty great in low light, so the Fuji F10, F11, F20, F30, and F31fd are all pretty great. Those are just the models I can think of off the top of my head.

      You're right, though, in that the F30 and F31fd are the only ones that go all the way up to 3200 iso.

  7. rapier1 says:

    I think the problem is that you are trying to use stuff you can essentially buy at Best Buy to do too much. A more specialized low light video cameral like or might be more functional. Hook it up to a video capture card and sample the stream as needed for your purposes. Of course, this might be a problem because the way this works when you hit the subject with a flash you'll overexpose the subject. Adn trying to use this for stills would probably confuse the hell out of the users (what? no flash? did it take a picture? etc etc etc).

    But this is really a problem that you'll be facing with almost any solution because you are asking one device to two different and in some ways contradictory tasks. I wouldn't be dumb enough to suggest to use two cameras that are well suited for the two different things you are trying to do. However, I might suggest that you reconsider how important both stills and video are to you.

    • jwz says:

      You have a point* but the thing is, Photoboof pulls this off, and it looks pretty good. Their software is Windows-only though, and I have standards.

      * but if you comb your hair differently it might not show.

      • rapier1 says:

        Actually photoboof only does still images, no video. Also, I would think how good photoboof looks is really going to depend on the camera - which is much more of a factor than the OS controling it.

        "Most other digital photobooths use video cameras, which have horrible color tone and no flash. Photoboof uses high quality digital stills cameras so it takes infinitely better pictures, and lets you use a flash for a traditional photobooth feel."

        If you stick just with still images you've solved your problem. So, did you deal with the printing yet? If not I expect to see a few more "Dear Lazywebs"...

    • romulusnr says:

      Seems like if you want the exposure so low that it will work great in low light (i.e. pre-capture, no flash) then you're going to have problems when you flood the subject with a flash, unless you deliberately plan for it and have a camera you can order it to drop the resolution on.

  8. allartburns says:

    Canon has a dev kit for their cameras, but I have no idea if it's worth the trouble of requesting:

  9. ihnatko says:

    Have you tried AppleScripting the Remote Capture app with GUI Scripting?

    The idea is that if the app doesn't have a "take a picture and save it" AppleScript command, you can tell the capture button "pretend that you've just been clicked." If it's a menu item, and there's a keyboard equivalent, it's even simpler: you just tell the app "Pretend that the user has just hit Command-Shift-L" or whatever.

    It's a bit messy -- you have to use a little Apple utility to sniff through the app's UI and identify the button you want to press -- but it pretty much means that there's no user action that you can't automate.

    • jwz says:

      Their UI opens two windows, and one of them has an embedded postage-stamp sized view that has the actual video in it. I seriously doubt there's a way to re-parent that view and make it be full screen and still have anything work. It's not just a matter of faking button clicks: I'd have to make 99% of their UI completely go away.

  10. netsharc says:

    This camera has an NTSC/PAL video output, you can get a PCI TV-tuner (or USB, if you're using a laptop) and wire the output to the video-in. Hacky, but I think it'd get the job done.

  11. pathwalker says:

    Have you tried running the firmware updater for the iSight?

    When I first got one, the low light performance really really sucked - it was pretty much unusable in anything but very bright light.
    After I updated to the latest firmware, it got a lot better, and was actually usable at parties.

  12. matthew says:

    Give iGlasses a try, it can tweak the iSight giving you much better performance and let you do all sorts of strange things with the video. There's a demo so you can see if it would help at all.

    • jwz says:

      Tried it, doesn't help much; it makes the image brighter but way grainier. It looks just as bad as starting with a dark image and cranking up the brightness in Photoshop.

  13. kraquehaus says:

    Why not get a camera pumping video in that you can deal with, then just get a separate flash that you trigger when you grab a shot?

  14. danomite55 says:

    Have you tried unplugging all devices but say the camera and mouse to make it easier to identify the devices in the tree?

  15. darkshadow2 says:

    Like, you get this list of USB busses and those have a list of devices on them (sensible enough). But the numbers in these device structures -- vendor ID, product ID, etc. -- have no correlation to the vendor and product IDs that are printed by System Profiler!

    You probably need to use the IOKit framework to get this info. There's some rather sparse examples in /Developer/Examples/IOKit/usb. I wish Apple had put the source code to USB Prober in the examples.

  16. inoci says:

    about an hour into the os x state of the union presentation they discuss some neato camera related things that will be introduced in leopard that will make doing this much easier than what you're going through right now. might be worth looking at/waiting for.

  17. aberkvam says:

    netik fought with gphoto2 for a while, and found that it can fire the camera and get the picture out, but it can't do video. Me, I can't even get gphoto2 to build on my iMac. DarwinPorts has libgphoto2, but it's two years old, and apparently the oldest gphoto2 that is still available doesn't work with that verion of the library. Or something. I have an instinctual aversion to this software anyway; it has the Linux Stink on it in a big way.

    MacPorts has the current libgphoto (devel/libgphoto2 2.3.1) and it compiled fine on my MacBook Pro. I also had to install popt from MacPorts and make some symlinks for it as mentioned in this post's comments. Then I just downloaded the gphoto2 tarball and compiled by hand, no problems.

    That same post mentioned that you have to kill the PTPCamera process. Until I did that, I got a 'Could not claim the USB device' error.

    Unfortunately I haven't been able to test actually grabbing pictures yet (The Canon PowerShot SD500 doesn't support remote control) but it does detect the camera and I can browse the filesystem. I will be trying a different Canon tomorrow.

    The gphoto man page claims it can grab movies. I have no idea if it will work or not but I am hopeful right now. We'll see if that hope is justified...