Imagine simply scanning a photograph with an app to determine whether a light or light fixture is dark skies friendly.
GLAS interns Sydney Simon and Olivia Boyd are working toward that.
“We’re going to evaluate light based on color temperature, luminous flux and light angle. We’re trying to determine the dark skies friendliness of certain light fixtures based on these three factors,” Sydney said in a late July presentation to staff and interns at GLAS Education.
The two University of Chicago astrophysics students are working on complimentary Python programs that can determine the luminous flux, color and light angle of fixtures and source.
While the envisioned process sounds easy, getting there is proving to be complicated. That’s because while a photograph might look like a representation of reality, it isn’t. What appears in a photo depends on the ambient light, whether that light was filtered, the angle of the lens and the speed of the shutter.
The students are working out ways around those problems.
Sydney is working on a program to determine the angle of light from a fixture.
The problem she has been solving is that light angles could be misrepresented by photos not taken straight on. Her app takes in night images of a light fixture (with the light on), and proceeds to filter out all parts of the image that aren’t in the image’s max intensity range. After applying the filter, her program applies an edge detection algorithm called “Canny,” which returns the filtered image with only the edges/lines left. Her program then applies a line detection algorithm called “Hough,” which filters out shorter lines that are unimportant to the image. The program then averages the angles of the lines detected with respect to the vertical axis. The averaging process helps cancel out the effects of a photo taken at a crooked angle.
Olivia is working on luminous flux and color temperature.
“I’m still working on the former. I am on the third iteration”, Olivia said.
“The color temperature program was a much easier project,” she said.Olivia explained that the color of a light is a function of its temperature [units: Kelvin (K)]. In short, the higher the Kelvin rating, the bluer the light. A light at 2000K (2,000 Kelvin) appears reddish-yellow. A light at 8000K appears bluish white. Using code she’s put together, Olivia said she can convert the RGB color streams to Kelvin ratings.
“It is pretty simple. Basically, it (the program) considers the RGB color streams among some other more nuanced factors.” Olivia said. R-G-B stands for red, green and blue– the three colors that usually make up the 24 bit pixels many images are made of. “It works well. The only thing I am trying to refine is its accuracy, which operates in a range of 600K. But, I’m not even sure if the range is that vast, because I have doubts that some of the lights in the images I ran were true to their color temperature labels”, Olivia said. Still, considering that color temperature is on a scale of 8000K, that margin of error isn’t terrible– around 7.5 percent. And, it is definitely good enough to give people a good indication of whether their light color is dark sky friendly.
Olivia is also experimenting with ways to determine light luminous flux through photos.
The differentiating aspects of the three iterations are as follows:
- The first iteration breaks down the photo’s pixels according to its RGB color values. But there is a problem called gamma.
“Whenever you take an image, the camera you took the image with, and even the computer you are viewing the image with, is manipulated by a gamma value,” Olivia said.
The camera gamma value compresses the image, and the monitor gamma value adjusts the brightness of the image.
Gamma values in cameras and monitors are usually between 2.2 and 2.4, Olivia said.
“It’s a way to modify the pixels to make the representation look better,” Olivia said. “But when it does that, it modifies the realistic representation of light in the image. So, if you’re trying to calculate luminous flux, then anything you’re doing with the image, if you haven’t accounted for a gamma value, is only the luminous flux with respect to the image on whatever digital platform you are using.”
- Her second iteration considers image metadata (ISO, f-stop, etc).
- In her most recent variation of the project, Olivia said she is piggybacking her program on a Python package that locates white points to identify the light’s color signature.
From there, using the ratio of illuminated pixels in the image, a rough estimate of radiant flux, additional scaling factors, and the assumption that the bulb is a black body, Olivia explains that she is moving towards being able to derive luminous flux.
The progress Olivia and Sydney have achieved so far has required considerable work, including plenty of trial and error. But the interns have ambitious goals.
They want to combine their luminous flux, light angle and light color temperature codes to create a program that would analyze a photo based on luminous flux, light angle and color temperature.
They then want to design a user-friendly interface so the program can be used on the GLAS dark skies website. That interface would also have an integrated scoring system that would rate the lighting fixture based on the factors of luminous flux, light angle, and color temperature to determine a light’s suitability for a dark skies environment.
Finally, Olivia and Sydney want to share their program with other dark skies organizations.
“I think this is something useful that we could present to somebody at the IDA (International Dark Sky Association) because it could be something very useful for them to use on their website,” Sydney said.