Using a camera for measuring light output (a project I am working on)

jenskh

Enlightened
Joined
Jan 21, 2008
Messages
248
Location
Norway
As some of you may have seen, I have been working on measurements of beam profiles using a lux meter, and presentation methods for the output for some time. I have taken measurements out from the center of the hot spot and radially outwards in several directions to get a representative result.

Earlier this month, I read this tread: Beam Reviews - Update 2/18/07 (added D-mini - also added/changed plots) and got very interested in the suggestion from
656nm at the end of the tread.

Since that, I have been investigating on how to use my camera to get the full output profile from my lights. The idea was to get the lux value in some million points by just one shot.

I painted a wall white with the most diffusive paint I could find, and made some marks as reference points. I put up my L2D at 1 m distance from the wall, took measurements at all reference points, and started to take photos.

I soon found out that it was not that easy as I had hoped. I could only get out the light level in 255 different steps from the photos. This is of course far to little if you want to measure levels of several thousand lux and down to a few. This means i have to take several photos with different exposures.

Another difficulty is that the relationship between light level in the photos and the lux value seems to be linear only for quite low levels. If the light level comes above 100 in the photo (255 is max) then the relationship becomes quite non linear. Regions of the photos with too low light level is difficult to use because a step of one level may mean a big difference in lux level.

I searched around to try to find image processing software that could help me with these problems, and I tried several, but non of them could give me what I wanted, and became very cumbersome to use. So I decided to take up old skills and make the analysis software myself (I worked a lot with programming up to about ten years ago).

I have based my code on the package called ImageMagick and the interface towards the C programming language called ImageWand.

The program I have written, reads in several photos, and compares them with the lux readings from my lux meter. It generates some tables, and writes out a lot of data indicating the accuracy of the conversion of the photos into lux values. There have been a lot of thinking, analysing and trials and error before I could get this to work, but now it does. Here are an example of what I can get out:
my.php


This picure is generated out of 9 different images shot with exposure times from 1 s down to 1/1000 seconds. In this picture, every pixel is proportional with the lux value except that I have increased the pixel values at the lower levels just to make them visible. Another alternative is to use a logarithmic scale for the lux levels.

There are a lot of details in this picture that is difficult to see since I have had to reduce to an allowable size. If you see closely, you can se that the rings in the center is skewed slightly to the left. I suspect this is due to specular reflection from my white wall. I will try out other white surfaces than the painted I have now to see if I can get rid of it.

When I am satisfied with my generated lux pictures, then I can take out any profile, and can of cource also very easily calculate the lumens value. I will then figure out the best ways of presenting the results, and present it also for my other lights.

By the way: Thanks a lot to 656nm for the idea.
my.php
 
Last edited:

HitecDrftr

Newly Enlightened
Joined
Nov 1, 2008
Messages
155
You said...

"I have been investigating on how to use my camera to get the full output profile from my lights."

I'm not sure you will ever get the full output profile from your lights if you don't have an instrument that looks directly into (Captures) all the light. You can get relative reflected values perhaps, but there will always be a loss of light.

WRT image processing software, have you tried ImageJ, the free, open source image analysis software from the National Institutes of Health? It's pretty powerful, and I'll bet you could get someone from their forums to help you.
 

Saint_Dogbert

Enlightened
Joined
Feb 5, 2009
Messages
405
Location
USA
Hi jenskh, that is a very interesting thing you've got going there. One thing you might try is seeing if your camera can shoot RAW, and generate 16-bit TIFF images of your beam. This will allow you to make fewer exposures, increasing the efficiency of your work flow, not to mention giving you more data to work with (4,092 levels of brightness for 12-bit RAW vs. 256 for 8-bit JPEG). As you found out, for photographing a flashlight beam you need a very high dynamic range to compensate for the linear response of the camera sensor vs. the logarithmic response of the human eye. I don't know anything about the software you are using, so this might not be possible with your camera, or you may already be doing it. Just a suggestion.:)
 
Last edited:

DM51

Flashaholic
Joined
Oct 31, 2006
Messages
13,338
Location
Borg cube #51
Interesting project. I'm moving it into the General section, as it isn't exclusively for LED Flashlights.
 

jenskh

Enlightened
Joined
Jan 21, 2008
Messages
248
Location
Norway
You said...

"I have been investigating on how to use my camera to get the full output profile from my lights."

I'm not sure you will ever get the full output profile from your lights if you don't have an instrument that looks directly into (Captures) all the light. You can get relative reflected values perhaps, but there will always be a loss of light.

WRT image processing software, have you tried ImageJ, the free, open source image analysis software from the National Institutes of Health? It's pretty powerful, and I'll bet you could get someone from their forums to help you.
Yes, of cource there is loss of light, but I am calibrating the intensity of the reflected light against the measurements from my lux meter, so I should in principle be able to get the full output profile.

Thanks a lot for your tip on ImageJ. I have not tried this one, and will check it out. I guess it will be difficult to get a general software that is as effective as the specialized software I have written. Now I make a setup file, and then it is only one command to go through all images the and produce the results. I do still need a software tool to analyze the photos to get ideas, and to check that everything is working as intended in my program.
 

jenskh

Enlightened
Joined
Jan 21, 2008
Messages
248
Location
Norway
Hi jenskh, that is a very interesting thing you've got going there. One thing you might try is seeing if your camera can shoot RAW, and generate 16-bit TIFF images of your beam. This will allow you to make fewer exposures, increasing the efficiency of your work flow, not to mention giving you more data to work with (4,092 levels of brightness for 12-bit RAW vs. 256 for 8-bit JPEG). As you found out, for photographing a flashlight beam you need a very high dynamic range to compensate for the linear response of the camera sensor vs. the logarithmic response of the human eye. I don't know anything about the software you are using, so this might not be possible with your camera, or you may already be doing it. Just a suggestion.:)
Thanks for the tip. Yes my camera (Canon 450 D) can shoot RAW images and that was what I started out with. I did however not find more light levels in those images than in the JPEGs, so I decided to go with them. May be it was just the software I used that did not show me the full potential of the RAW images. I will investigate this further.
 
Top