Close

Just "some LEDs attached to a camera"? Not exactly.

A project log for Affordable Reflectance Transformation Imaging Dome

A simple and inexpensive way to image and analyze subtle surface details on objects.

leszek-pawlowiczLeszek Pawlowicz 09/15/2016 at 01:280 Comments

A post today on the Hackaday blog linked to a previous blog post on my project, so I took a look at that page for the first time in over a month. Bunch of comments about random technical issues, but one in particular struck me. The author said that my project was "not much more than some LEDs mounted to a camera", and that he could build a comparable system for less than $100. I had to smile - I used virtually the same words to a friend of mine three-and-a-half years ago when I started working on the idea, including that exact dollar amount. Turned out that there's a whole lot of complications that you don't think about until you actually start working on a project like this.

The main idea the author had was that you could use inexpensive addressable RGB LED strips like this one to simplify the whole process of controlling the lighting, as well as cutting the cost. Nice idea, but three big problems that aren't immediately obvious:

1. The LEDs on these 1-meter strips use 60 mA of current each (3.5 A strip total / 60 LEDs). I spent a lot of time figuring out how powerful the LEDs needed to be in order to light up a system up to a meter in diameter. My first thought was to power LEDs individually from Arduino Mega outputs, which limited me to 30 mA current (spec max is 40 mA, but it's recommended you stay away from that if possible). I tried "superbright" LEDs, in both straw-hat variety (wide uniform light dispersion), and focused (bright in the center, but narrow non-uniform beam). The straw-hats simply didn't have enough light intensity for reasonable camera exposure times even with smaller domes, a minimum of several seconds. The focused LEDs resulted in reasonable exposure times, but the small size of the lit area and its non-uniformity made them an unacceptable choice. Based on my initial experiments, I calculated that I needed at least 100 mA of current for reasonable exposure times for large domes with wide dispersion LEDs, and bought 0.5 W straw-hat LEDs for that. Turns out I was optimistic, and the exposure times for the first dome I built (18" diameter) were on the order of a second or more, which translates to more than 4 seconds for larger domes. And this was with the lowest f-stop I had; dropping the f-stop to improve depth of field could increase exposure time by a factor of 4 or more. An upgrade to 350 mA / 1W LEDs brought that exposure time to about 1/2 a second, which would translate to 2 seconds for a larger dome, but still not good enough. That's why I ultimately went to my current design, which supports 1 A / 3W LEDs, and could in principle be modified to double that. 60 mA LEDs just aren't powerful enough.

A recent paper by Ted Kinsman had similar results. He built his own independent RTI system (at least partially inspired by my results, based on his references). He uses an Adafruit LED matrix driver that supplies a maximum of 50 mA of current to his LEDs. With a 12" diameter dome, and a macro lens stopped down to f/8.0, his exposure times were 4 seconds, which translates out to 40 seconds for a one-meter dome. OK for a small dome, albeit a bit slow, but way too long for a big dome.

Why are big domes important? Because a rough rule of thumb is that the largest object you can accurately image with Reflectance Transformation Imaging is half the distance to the light source you're using. So for a 12" dome, 6" radius, that's 3". I think this is conservative, and you can do a bit bigger, but there's still a limit. Larger domes allow for accurate imaging of larger objects - a one meter dome can image an object about 10" in size.

2. When I was testing the 30 mA LEDs, I found that the variation in light intensity between different LEDs was as much as 20%. Reflectance Transformation Imaging requires that the light sources be as close to the same intensity as possible, otherwise the final result may be an inaccurate fitting of the light curve. I wasn't sure about the reason, but a bit of research brought up the most reasonable answer. While LEDs are sold with a quoted forward voltage for a specific current, what you actually get from a bunch of LEDs is a spread of forward voltages centered around the specification. Given how steep an LED I vs. V curve can be, a small change in Vf can result in big changes in the current, and big changes in the light intensity (see Grumpy Mike's excellent discussion of these issues). The current-limiting resistor commonly used with low-current LEDs is there to drop the voltage across the LED so that you don't burn it out, and not to specifically control the exact current. Given the low cost of the LED strip, I have to believe that it uses resistors to limit current to the LEDs, which could translate into substantial differences in output power between different LEDs. Not acceptable. My system has always used adjustable constant current regulators to get around this problem.

3. Finally, RGB LED strips create "white" light by turning on the red, green and blue LEDs simultaneously. While it looks "white" based on appearance, it's not a very good white. Here's a "white" spectrum from an RGB LED:

Not very uniform. Now here's a spectrum from a neutral white Cree LED (the green line), like the ones I spec for my system:

Much more balanced and uniform over the visible spectrum, with a peak near the blue end. This is easier to color correct than the RGB "white" spectrum.

There are other issues as well associated with the cost, like not including $36 shipping for the dome, or the fact that you'd need not just one LED strip to achieve the angular coverage needed for RTI, but more like 16, for a total additional cost of $170. Factor all those in, and you wind up with a system that doesn't cost that much less than the one I'm building, but has potentially serious or even fatal flaws, and can't be scaled up to larger sizes.

So is my system "not much more than some LEDs mounted to a camera"? I guess you could say that, but a hell of a lot more thought and effort went into that than you might think.

Discussions