mattie_shoes
Compact Flourescent spectrum
So I wrote a program that could read the red, green, and blue values making up each pixel in an image. Now by reading a line of an image, I could get the spectrum my sensor sees with the red, green, and blue pixels. But there's some noise so ideally we'd like to use multiple lines so hot pixels and dead pixels aren't a problem.
I made it adjust each line so the values are about the same. That way it's still weighting the dimmer parts of the image significantly.
The other problem is the lines might not be exactly vertical -- I was just hand-holding the camera. If the lines were slightly tilted, it'd blur out small peaks and whatnot. So I wrote something that would figure out if it should shift the line relative to the line above/below it -- Indeed, it found my picture was skewed somewhat, but the offsets make a nice line, so I think it's working.
This is the result. The peaks on the graph correspond to to the spectrum I found on wikipedia, so I picked the four major peaks and their wavelengths in nanometers, and I plotted them against the column number in my picture, and found they made an almost perfect line (R squared of .9999). So now I can interpolate and extrapolate the wavelengths of every column in my image. Now I have a real X axis :-)
A few things I noticed
The red line drops down to zero in the blue and green peaks. I double checked the original image and it was the same. I don't know what the deal is with that. I don't think the other spectrums i took pictures of did that. . .
The blue pixels seem to have a very extreme filter from 530-580nm.
Green crosses above blue at a certain wavelength. In theory, that wavelength should be the same regardless of the light source. Ditto for red crossing above green.
Compact Flourescent spectrum
So I wrote a program that could read the red, green, and blue values making up each pixel in an image. Now by reading a line of an image, I could get the spectrum my sensor sees with the red, green, and blue pixels. But there's some noise so ideally we'd like to use multiple lines so hot pixels and dead pixels aren't a problem.
I made it adjust each line so the values are about the same. That way it's still weighting the dimmer parts of the image significantly.
The other problem is the lines might not be exactly vertical -- I was just hand-holding the camera. If the lines were slightly tilted, it'd blur out small peaks and whatnot. So I wrote something that would figure out if it should shift the line relative to the line above/below it -- Indeed, it found my picture was skewed somewhat, but the offsets make a nice line, so I think it's working.
This is the result. The peaks on the graph correspond to to the spectrum I found on wikipedia, so I picked the four major peaks and their wavelengths in nanometers, and I plotted them against the column number in my picture, and found they made an almost perfect line (R squared of .9999). So now I can interpolate and extrapolate the wavelengths of every column in my image. Now I have a real X axis :-)
A few things I noticed
The red line drops down to zero in the blue and green peaks. I double checked the original image and it was the same. I don't know what the deal is with that. I don't think the other spectrums i took pictures of did that. . .
The blue pixels seem to have a very extreme filter from 530-580nm.
Green crosses above blue at a certain wavelength. In theory, that wavelength should be the same regardless of the light source. Ditto for red crossing above green.