Anyway, right now I'm frustrated trying to figure out the linearity of the sensor and how the gamma corrections play into it. I thought that if I took a Kodak grey chart (which is linear in density), photographed it, then measured the grey values in an output jpeg, they would not come out linear because of the gamma correction. But they do! I also thought that if I took a RAW image, and processed it to jpeg with a gamma correction of 1, it would come out linear. It distinctly does *not*. Clearly I am confused. Bah. If anyone understands this, please explain it to me. I wish now that my camera output tiffs, because then I wouldn't need to screw around with any of this jazz. Maybe I should look into using a different camera - bleh!
I've been using DCRaw to convert my RAW NEF to a ppm. DCRaw is cool! It is one C file. It handles a gazzilion cameras. The variable names are too short, but in general the code is actually readable, this is extra cool, because I think I have to mod it. :) Right now I'm playing with tweaking its auto brightness correction which it turns on when outputting things in 8bit. This is bad since I've intentionally used the same exposure and aperture to capture all the images in my panorama, then this cheeky piece of software silently goes and mucks up the gain! I need to figure out if there's some magic clip value I can use for my CCD, or if I should read in all my images and create a histogram across all of them. Since I'm taking care with the exposure I'd think there should be a value that will always work reasonably.
Anyway, Gamma sucks!
Oh! I also found this really really cool link explaining the history of CCD/CMOS cameras and the nitty gritty of how they work: http://www.extremetech.com/article2/0,1558,15465,00.asp. I now understand why I can't have my DSLR give me a live update of the scene on the LCD like the consumer digital cameras do, the current trade-off for a 'full frame' CCD rather than an 'interline' requires a physical shutter.