Categories
Uncategorized

Processing PhotoBooth

You probably know I’m a fan of Photo Booths, and while Sparkbooth is awesome software, you might want something free (and open source) so here’s “PhotoBooth” written in Processing.

This is all the code you need for the most minimal photo booth application:

/**
 * PhotoBooth.pde
 */ 
 
import processing.video.*;
Capture cam;

void setup() {
  size(1280, 720);
  cam = new Capture(this, 1280, 720);
}

void draw() {
  if (cam.available() == true) {
    cam.read();
    image(cam, 0, 0);
  }
} 

void keyPressed() {
    if (key == ' ') {  // space bar
      saveFrame("picture-####.jpg");
    }
}

Once you’ve got that, you can export it as an application from Processing.

(Note that I’m using a Logitech C910 webcam, so I’ve set the resolution to something that makes sense for that camera. If it looks weird with your camera, try 640×480 or something else.)

PhotoBooth Export Application

I generally use Mac OS X, but other operating systems are supported. This is one of the great things about Processing.

PhotoBooth Application

Over in the Finder you’ll see a standalone application named “PhotoBooth” that will run fullscreen when launched. (You can exit it by hitting the escape key.)

Spazz!

Once you launch it you’ll see some spazzy dude, wait, that’s me! You’ll probably see yourself instead.

Hit the space bar, and it’ll save a photo. Hit the space bar again and it’ll save another one. And on, and on.

PhotoBooth Photos

The photos will show up in the same folder as the application. They will have a random number in the name. It’s not sequential, but you can view by date created if you need them in order.

Here’s a more full version of the Processing code with a few extras commented out. Uncommenting them may prove useful for debugging or camera set-up.

/**
 * PhotoBooth.pde
 */ 
 
import processing.video.*;
Capture cam;

void setup() {
  size(1280, 720);

  // If no device is specified, will just use the default.
  cam = new Capture(this, 1280, 720);

  // To use another device (i.e. if the default device causes an error),  
  // list all available capture devices to the console to find your camera.
  //String[] devices = Capture.list();
  //println(devices);
  
  // Change devices[0] to the proper index for your camera.
  //cam = new Capture(this, width, height, devices[0]);

  // Opens the settings page for this capture device.
  //cam.settings();
}

void draw() {
  if (cam.available() == true) {
    cam.read();
    image(cam, 0, 0);
  }
} 

void keyPressed() {
    if (key == ' ') {  // space bar
      saveFrame("picture-####.jpg");
    }
}

And hey, I know that hitting the space bar ain’t cool… so you might want to use an awesome button instead.

This is a super-simple application, which basically takes some example code that ships with Processing and adds a bit to it. I hope to have a few more posts that talk about some changes you can make to this application. Stay tuned!

Categories
Uncategorized

The iPhone 4S Camera

I’ve been meaning to do some iPhone 4S camera tests for a while now, and rather than wait and wait while I come up with a scientific method, I thought I’d just do a few shots and post them here. Early and Often, right?

Each photos links to the Flickr version you can view it at various sizes. None of the photos have been retouched at all.

iPhone Test 01
Normal iPhone 4S photo with direct light.

iPhone Test 01 (HDR)
HDR iPhone 4S photo with direct light.

iPhone Test 02
Normal iPhone 4S photo with soft light.

iPhone Test 02 (HDR)
HDR iPhone 4S photo with soft light.

For each shot the iPhone was on a tripod, and an overheard light consisting of a single bulb was used. (It’s a large high wattage bulb from an old photostat machine.) For the soft light shots, I put an umbrella in front of the light. I used Apple’s default Camera app that comes on the iPhone. All were shot on the white sweep I use for all my tabletop stuff. (If you’ve seen my Flickr stream, you’ve seen plenty of shots on that sweep.)

iPhone Tripod Mount
Experimental iPhone Tripod Mount

This photo of my “Experimental iPhone Tripod Mount” was taken (handheld) with my Nikon D40. If you wanted to compare the two, the iPhone 4S is supposedly an 8 Megapixel camera, while the Nikon is a 6 Megapixel camera. Size isn’t everything of course. Well, the Nikon does have a bigger lens, so that helps quite a bit. The Nikon also shoots in RAW, and yes, this shot has been edited quite a bit, but hey, that’s what I do with RAW photos. (And I mainly took this shot to show the set-up I used.)

When I get ambitious again, I’ll set up two tripods, one with the iPhone, and one with the Nikon, and do duplicate shots of various objects. Until then, enjoy these… I’m off to work on my Experimental iPhone Tripod Mount Version 2.0

Categories
Uncategorized

Fire the Laser!

I finally got some quality time with the Laser Cutter at Milwaukee Makerspace, and I have to say, I’m fairly pleased with the results!

Milwaukee Makerspace Logo

I started with the Milwaukee Makerspace logo (in SVG format) in Inkscape, and exported it as a DXF file. (I also kept the stroke of the width just 1 pixel for all the lines.)

Once I had a DXF file, I was able to import that into CorelDRAW, which is what the PC that controls the Laser Cutter uses to do the work. There’s a bit of trickery in CorelDRAW between raster and vector artwork, but doing it this way with a DXF file at just one pixel wide seemed to force it to work in vector mode, which is what I wanted.

Laser Etched Wood

Knowing the power and speed settings for the Laser Cutter are tricky, and require a bit of experimentation based on if you are etching or cutting, and how deep you wish to etch or cut. The nice thing is, as long as you don’t move whatever your material is, you can run the Laser Cutter multiple times to go deeper, or complete a cut. In many cases this may be the way to go… (More on that later!)

It’s worth noting that some materials should NEVER be cut. Since our pals at PumpingStation: One already have a list, I’ll point you to the NEVER CUT THESE MATERIALS list on their their wiki. The also have this cool list of laser settings. (Yeah, we’re working on that as well. We have a different laser, so we need to start from scratch.)

Laser Etched Wood

Here’s a close-up of the etching into wood. I ran it a few times. If you’re doing a vector cut, it just traces around the outline, and goes super-fast. If you are using raster artwork, it’ll behave like an old dot-matrix printer and go line-by-line and take forever. Shane did this Periodic Table and it took almost two hours. (It does look pretty amazing though!) I’m still not 100% sure what CorelDRAW does with each format. I tried to import an SVG file but it seems to convert it to raster format. The DXF kept its vector format, so I’ll stick with that for now.

Laser Etched Plastic

After I was satisfied with wood, I moved on to plastic. When I say plastic, I mean “plastic” and I don’t know if it’s acrylic, or plastic, or what kind of plastic, or anything else, so I’ll just leave it at that for now. (And yes, we’ve got a nice scrap pile of plastic at the Makerspace to experiment with.)


Laser Etched Plastic

This is just an outline of the logo, but we should be able to use a filled-in logo (in raster format) and create the effect of frosted glass, and then we can do this Floating Glow Display project from Make with our laser-etched plastic. Hmmm, it looks like I just gave myself another project to tackle!

Categories
Uncategorized

Pachube Learning

Pachube I first heard of Pachube shortly after it launched, and took a look at it, but didn’t really have any data to feed it. Then they started charging for the service, so I never pursued it, and then they got acquired by LogMeIn, and became free again, so I figured I’d check it out.

If you’ve seem my posts about logging the temperature and humidity, then you can guess what data I started feeding into Pachube.

Take a look at the feed Environment for a constantly-updated view of my office. We’re tracking the temperature and the humidity, but I’d also like to add a photocell (light sensor) and occupancy sensor (PIR) at some point.

I dabbled in Processing code, but ended up going back to Perl after some instability. There’s still some issues with bad data I need to sort out. (See below.)

Bad Data

There’s not a lot of amazing code in place yet, as it’s all learn-as-I-go experimental, but that’s fine with me…

Pachube iPhone

I mean, as it stands right now, I can quickly see the status of my office from anywhere in the world as long as I’ve got a mobile phone and an Internet connection. That alone should be worth something…

I’ve been adding updates along the way over at the project page on the Milwaukee Makerspace wiki. I’m sure I’ll have more blog posts on this, but smaller updates will probably just show up on the wiki.

Categories
Uncategorized

Holiday Make-A-Thon 2011 ReCap

I had a fun time at the Holiday Make-A-Thon and everyone else there seemed to as well…

There was painting, and decorating, and soldering, and knitting, and 3D printing, and gourds, and ABS, and PCBs, and yearn, and glue, and even some glitter!

Big thanks to the Milwaukee Makerspace guys for teaching people to solder, and for helping me out with the wooden ornaments. More thanks to Bucketworks for hosting the event. Based on the feedback we got, I’m going to assume we’ll do it again next year.

Here’s a few snapshots I got during the event.

Ornaments

Some of the wooden ornaments painted and glittered up. (Thanks to Brant from Milwaukee Makerspace for the googly eyes.)

Penguin

I’m not 100% sure but I think this dried gourd penguin was made by Amanda from Milwaukee Makerspace. (Please correct me if I’m wrong.) My kids told me it was the most awesome gourd they saw all day.

Reindeer

These reindeer from Brant are extra-cool because they were made from the scraps of the first test of my cucoloris design. They were sitting around the space near the CNC Router and he found a neat way to upcycle them.

Starclops

I may be biased, but Starclops, which was created by hot-gluing a star ornament onto a snowman ornament, adding a googly eye, and using a soldering iron to brand it, may be the best thing I made that day.

And finally, thanks to all the folks who showed up. Rather than battling the crowds at the malls you opted to join us and make something with your own hands… and that’s pretty cool. We need more of that in this world. :)