Luminous Landscape Forum

Equipment & Techniques => Digital Cameras & Shooting Techniques => Topic started by: Jim Kasson on March 18, 2013, 06:45:19 pm

Title: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 18, 2013, 06:45:19 pm
If someone has already discovered this technique and posted a reference to it here, I apologize, and will remove the post if it contributes nothing further. I've done searches and haven't found anything, but I may have missed something.

Anyway, here goes. On the RawDigger site, there's a technique for computing Unity Gain ISO (http://www.rawdigger.com/howtouse/pixel-capacity-and-amplifier-gain). It is basically a search over several exposures made with the camera ISO setting at different places for the ISO setting that, with a flat, relatively bright (but not saturated) compact target rectangle, produces a standard deviation in the (pick a channel) raw values that's the square root of the mean raw value in that channel.

I thought there ought to be a way to do the same thing without a search. I applied some algebra to the problem, and came up with the following algorithm: Set your camera to some middling ISO; call that value ISOtest. Point your camera at a featureless target. Defocus a bit to make sure you don't have any detail. Expose so that the target is about Zone VI, or a count of about 4000 for a 14-bit ADC. If you have a 12-bit ADC in your camera, try for a count of 1000. Bring the resultant image into RawDigger, select a 200x200 pixel area, and read the mean and standard deviation for each color plane. For each plane, call the mean Sadc and the standard deviation Nadc. The unity gain ISO is ISOtest*Sacd/(Nadc^2). Average all three color channels for the Unity Gain ISO of the camera.

I tried the algorithm out on a Nikon D4 over a range of ISOtest values, making 16 exposures for each ISOtest value and plotting the mean Unity Gain ISOs, the mean plus two standard deviations, and the mean minus two standard deviations.

The result looks like this:

(http://www.kasson.com/ll/D4ZoneVIUnityGainISO.PNG)

All of the Unity Gain ISOs are within about a third of a stop, so the accuracy is probably good enough to make this a useful measurement; I don't know why I'd want to know the Unity Gain ISO to greater accuracy than that. There is some systematic variation. Some of it may be due to the fact that, for the measurements at ISO 100, 200, and 400, the camera is below the Unity Gain ISO and the statistics of the image my be affected enough to skew the results. I'll be doing some simulation to see if that's a reasonable explanation.

I've done tests at other exposure levels (mean raw values) and the results are only weakly dependent on exposure. I've done similar tests on the following cameras: Nikon D800E, Leica M9, Sony NEX-7, and Sony RX-1, and, with the marginal exception of the Leica, all the results for each camera model cluster within a third of a stop of each other.

The math I used to derive the above equation and the Nikon D4 results are here (http://blog.kasson.com/?p=2896). The results for the other cameras are here (http://blog.kasson.com/?p=2904).

I welcome discussion on what might be the source of the systematic variations, which indicate that the simple model I used is incomplete. In the case of the Sony cameras, the raw files are compressed in a way that reduces the resolution in the lighter values. That might be a possible source. I think the value of understanding the systematic variation is to better understand the internal makeup of the cameras, since the test appears to be sufficiently accurate even with this variation.

jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: eronald on March 18, 2013, 09:33:22 pm
I see I can look forward to actually reading this :)

Thank you!

Edmund
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 18, 2013, 10:00:00 pm
It turns out that you can take the same data and compute full-well capacity, if you assume that the well fills as the ADC output approaches full-scale at base ISO. The full-well capacity should be proportional to photosite area, all else being equal. With the CCD-based Leica M9 in the mix, all else is not equal:

(http://www.kasson.com/ll/Fullwell.PNG)

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 18, 2013, 10:35:18 pm
What is the purpose of knowing the Unity Gain ISO?  What practical purpose does it have?  Similarly what practical purpose does knowing the full well capacity have?  Are we able to use the information to determine exposure on the fly, in the field?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Vladimirovich on March 18, 2013, 11:08:06 pm
What is the purpose of knowing the Unity Gain ISO?  What practical purpose does it have? 

http://www.rawdigger.com/howtouse/pixel-capacity-and-amplifier-gain
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 18, 2013, 11:13:52 pm
What is the purpose of knowing the Unity Gain ISO?  What practical purpose does it have?

There is little to be gained in increasing the camera ISO setting much beyond the Unity Gain ISO. All you're doing is losing headroom, and you're not reducing the noise in the raw file. You're better off letting the histogram slide towards the left and cranking up the Exposure control in Lightroom or ACR. That's assuming you can see the playback image in the camera LCD (derived from the raw preview JPEG, and therefore affected by the camera ISO setting) well enough to do all the chimping you want to do.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 18, 2013, 11:22:07 pm
Similarly what practical purpose does knowing the full well capacity have?  Are we able to use the information to determine exposure on the fly, in the field?

The full-well capacity is a pretty darned good indicator of the dynamic range of the camera. It's a nice thing to know when you're trying to decide what camera to buy, or what camera to use for a particular job.

Once you've purchased the camera and are using it, you might use the dynamic range of the camera to determine when you need to use HDR, averaging, or similar techniques to get more shadow detail. You can't do that directly from the full-well capacity, but you could take the log base 2 of the full-well capacity, and subtract 4 to 7 stops (some people say you need 100 electrons for photographic quality, and that's a tad under two to the seventh) to account for the signal-to-noise ratio (SNR) you want in the shadows, and what's left would be the approximate difference, in stops, between the highlights and the shadows-with-detail (Zone II or III).

Here's the graph with a log base 2 vertical axis to make it easy for you to do the math in your head:

(http://www.kasson.com/ll/FWstops.PNG)

This ignores dark noise, read noise, and other things that affect the shadows but not the light tones. It also ignores resolution, and you can decrease noise in an image by rezzing it down. In practice, I've found the D4 and the D800 to give similar noise performance at similar resolutions. If we compute the dynamic range by averaging the photosites to get to 12 megapixels for each camera, we see that, except for the M9, the size of the sensor pretty much detirmines the dynamic range:

(http://www.kasson.com/ll/FWstops-rescor.PNG)

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 09:13:27 am
There is little to be gained in increasing the camera ISO setting much beyond the Unity Gain ISO. All you're doing is losing headroom, and you're not reducing the noise in the raw file. You're better off letting the histogram slide towards the left and cranking up the Exposure control in Lightroom or ACR.

OK, that makes sense.

Quote
That's assuming you can see the playback image in the camera LCD (derived from the raw preview JPEG, and therefore affected by the camera ISO setting) well enough to do all the chimping you want to do.

Jim

Very rarely chimp.

Quote
The full-well capacity is a pretty darned good indicator of the dynamic range of the camera.

True.  Although with advances in technology I think it's a less valuable indicator. 

Quote
It's a nice thing to know when you're trying to decide what camera to buy, or what camera to use for a particular job.

Less enthralled by that concept.  We were using slide film with, maybe, a 6 stop brightness range for decades and felt it 'did the job' quite nicely.  Any camera that has that or more should be suitable.

Quote
Once you've purchased the camera and are using it, you might use the dynamic range of the camera to determine when you need to use HDR, averaging, or similar techniques to get more shadow detail. You can't do that directly from the full-well capacity, but you could take the log base 2 of the full-well capacity, and subtract 4 to 7 stops (some people say you need 100 electrons for photographic quality, and that's a tad under two to the seventh) to account for the signal-to-noise ratio (SNR) you want in the shadows, and what's left would be the approximate difference, in stops, between the highlights and the shadows-with-detail (Zone II or III).

Here's the graph with a log base 2 vertical axis to make it easy for you to do the math in your head:

Why bother with all of that?  Why can't sites like DxO or other 'credible' review sites be used for that information?  DxO, for example, suggests the D800 has a drange of just over 13 stops at ISO 100 when the noise floor is SNR=1.  Knowing that SNR=1 isn't a practical limit, why can't I simply subtract 2 or 3 stops from the DxO number and consider that the practical brightness range of the sensor?  All that aside, one still needs to know the brightness range of the scene/subject being shot or all the math is moot. 


Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 19, 2013, 09:17:08 am

I thought there ought to be a way to do the same thing without a search. I applied some algebra to the problem, and came up with the following algorithm: Set your camera to some middling ISO; call that value ISOtest. Point your camera at a featureless target. Defocus a bit to make sure you don't have any detail. Expose so that the target is about Zone VI, or a count of about 4000 for a 14-bit ADC. If you have a 12-bit ADC in your camera, try for a count of 1000. Bring the resultant image into RawDigger, select a 200x200 pixel area, and read the mean and standard deviation for each color plane. For each plane, call the mean Sadc and the standard deviation Nadc. The unity gain ISO is ISOtest*Sacd/(Nadc^2). Average all three color channels for the Unity Gain ISO of the camera.

I tried the algorithm out on a Nikon D4 over a range of ISOtest values, making 16 exposures for each ISOtest value and plotting the mean Unity Gain ISOs, the mean plus two standard deviations, and the mean minus two standard deviations.

I welcome discussion on what might be the source of the systematic variations, which indicate that the simple model I used is incomplete. In the case of the Sony cameras, the raw files are compressed in a way that reduces the resolution in the lighter values. That might be a possible source. I think the value of understanding the systematic variation is to better understand the internal makeup of the cameras, since the test appears to be sufficiently accurate even with this variation.

Jim,

A truly excellent piece of work. I would suggest using a somewhat lower DN (data number) than a 14 bit value of 4000. At high DNs, PRNU (pixel response non-uniformity) is increasingly prominent. And at low DNs, read noise becomes significant.

I did an analysis of my D800e using Roger Clark's methodology with ImagesPlus, which uses 16 bit DNs. One can convert to 14 bit DNs by dividing by four. The observed standard deviation is almost entirely the sum in quadrature of the shot noise, PRNU, and read noise. PRNU can be eliminated by subtracting two identical exposures and determining the SD for the subtracted image. This is the noise for two images, and the SD for 1 image is obtained by dividing by sqrt(2). The results are shown below with exposures giving 14 bit DNs of 4000 and 1000 and 16 bit DNs of 16000 and 4000 highlighted in yellow.

At the 16 bit DN of about 16000, the SD is contaminated by PRNU. The observed SD is 156 and the corrected SD is 144. At a 16 bit DN of around 4000, the observed SD is 73.8 and the corrected SD is 72.3.

Regards,

Bill





Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 09:25:40 am
http://www.rawdigger.com/howtouse/pixel-capacity-and-amplifier-gain

Thanks.  Nice article.  Takes a technical concept and explains it such that an engineering degree isn't needed to decipher it.  Too rare an occurrence.  See the response directly above for the typical bit of bafflegarb.  ::)

One question.  Why only the G channel?  Why not the entire signal of the entire sensor?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 19, 2013, 10:49:10 am
Why bother with all of that?  Why can't sites like DxO or other 'credible' review sites be used for that information?  DxO, for example, suggests the D800 has a drange of just over 13 stops at ISO 100 when the noise floor is SNR=1.  Knowing that SNR=1 isn't a practical limit, why can't I simply subtract 2 or 3 stops from the DxO number and consider that the practical brightness range of the sensor?  All that aside, one still needs to know the brightness range of the scene/subject being shot or all the math is moot.  

Bob,

There are many ways to approach the technical side of photography. Some people just ignore it, and are perfectly happy with their iPhones and P&S cameras with auto-everything and tiny sensors. Other people believe that the more you understand about your tools the better you can use them, and that deep understanding comes through experimentation. I'm mostly in that camp. Those are the extremes, and it sounds like you are somewhere in between. That's great. If if works for you, keep at it. I'll applaud.

If you'll bear with me, I'll take this opportunity to expand on what I get out of testing and calibration. I'll concentrate on cameras, but, for me, the attitude that I want to do as much as possible for myself extends throughout the photographic process. For example, I make my own printer profiles. It's expensive in equipment and time, and the results may or may not be better as judged by someone other than me, but I like taking control, and I like the fact that I can tweak the profile to do exactely what I want it to do.

Have you ever taught a workshop or course on a subject you know well? I have, and, every time I'm surprised about how much I learn about the subject that I thought I knew cold. Trying to come up with simple explanations for complicated things makes me understand the complicated things more deeply. Student questions sometimes come out of left field, approaching the subject from a direction that I'd never considered makes me dig deep and come up with a new way to think about the subject.

Testing's like that for me. Developing the test makes me think harder about what I'm testing for than just reading about it on the DxO site. When I go to do the testing, things never go exactly the way I thought they'd go, and I learn something from that. One of the things that I often do is perform tests many times and collect statistics on the results. I don't see that on test web sites very often. Having access to the statistics lets me figure out the accuracy, and even the statistical importance, of a result.

Sure, there are people who spend all their time testing and never make good pictures. They're not new; some of the Zone System acolytes did the same thing. I call it the sharpening pencils syndrome (http://blog.kasson.com/?p=9). But there are others who use their deep knowledge of the technology to make better pictures.

Bob, I'm not trying to convince you to go with my approach. You've got something that works the way you want it to work, and then it's perfect for you; I'm just trying to help you understand where I'm coming from.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 19, 2013, 10:59:38 am
I would suggest using a somewhat lower DN (data number) than a 14 bit value of 4000. At high DNs, PRNU (pixel response non-uniformity) is increasingly prominent. And at low DNs, read noise becomes significant.

Bill,

Thanks for the tip, and for the explanation. I will do some further testing and report. I have enough data collected to do most of the work stemming from your post on previously-made exposures (a good thing when I have to make so many ones under identical conditions to understand the statistics), although most of my data is for dark noise and at Zones III and VI. I notice the DxO does their noise testing at Zone V. Your results suggest the Zone IV is better.

Jim

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 11:20:42 am
Bob,

There are many ways to approach the technical side of photography. Some people just ignore it, and are perfectly happy with their iPhones and P&S cameras with auto-everything and tiny sensors. Other people believe that the more you understand about your tools the better you can use them, and that deep understanding comes through experimentation. I'm mostly in that camp. Those are the extremes, and it sounds like you are somewhere in between. That's great. If if works for you, keep at it. I'll applaud.

No, I'm all for testing and experimentation.  It becomes a matter of time and necessity.  Also perhaps a matter of convenience.  If I can rely on the experience of a source that's dedicated to certain types of testing then it becomes a matter of 'why reinvent the wheel'.  There's also the point of diminishing returns that has to be considered as well.  I don't think some do that.  Some feel that getting the nth to the 12th power degree of accuracy is important.  And it may be to them but it has zero practical relevance.


Quote
Have you ever taught a workshop or course on a subject you know well? I have, and, every time I'm surprised about how much I learn about the subject that I thought I knew cold. Trying to come up with simple explanations for complicated things makes me understand the complicated things more deeply. Student questions sometimes come out of left field, approaching the subject from a direction that I'd never considered makes me dig deep and come up with a new way to think about the subject.

Many times.  And I absolutely agree with what you're saying.  It's a great aspect of the interchange between you and the people you're teaching.  Authoring a book is much the same.  I've had a number of useful and interesting comments from people who've read mine.

Quote
Testing's like that for me. Developing the test makes me think harder about what I'm testing for than just reading about it on the DxO site. When I go to do the testing, things never go exactly the way I thought they'd go, and I learn something from that. One of the things that I often do is perform tests many times and collect statistics on the results. I don't see that on test web sites very often. Having access to the statistics lets me figure out the accuracy, and even the statistical importance, of a result.

Sure, there are people who spend all their time testing and never make good pictures. They're not new; some of the Zone System acolytes did the same thing. I call it the sharpening pencils syndrome (http://blog.kasson.com/?p=9). But there are others who use their deep knowledge of the technology to make better pictures.

I understand.

Quote
Bob, I'm not trying to convince you to go with my approach. You've got something that works the way you want it to work, and then it's perfect for you; I'm just trying to help you understand where I'm coming from.

Jim

And I'm not trying to criticise your approach.  I'm trying to understand what you feel you gain from it.  I'm trying to learn.  I do that by asking questions and challenging points of view.  I've learned some interesting things from this thread and the article at RAWDigger.  So thanks.  :)
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Vladimirovich on March 19, 2013, 11:42:58 am
One question.  Why only the G channel?  Why not the entire signal of the entire sensor?
what is entire singal of the entire sensor ? the fact is that you have 4 channels (typically), sometimes the difference is just because of CFA, but sometimes indeed the manufacturer can do differen things for different sensels based on where under CFA they are located, etc... so you can average 4 channels or use the strongest one (like G1/G2) for a typical daylight... rawdigger website has a forum - you can ask authors directly - they are quite prompt if a good question is asked.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 12:59:29 pm
The signal for the entire sensor would be the sum of the 4 channels, would it not?

Thinking about this testing a bit more, I'm wondering how it relates to the concept of the 'ISO-less' sensor that people talked about, mostly, when the D7000/K5D came out.  The thought there was that it made no sense to increase ISO because of the essentially equal drop in drange for each 1 stop increase in ISO and that simply underexposing and pushing in the RAW converter would serve the same purpose.  The D800 sensor behaves much the same way yet it appears that it does make sense to increase ISO up to a point.  Is there conflict between the two schools of thought?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 19, 2013, 01:13:23 pm
Why only the G channel?  Why not the entire signal of the entire sensor?

Bob,

I thought that was a good question, so I looked at all three channels, plus their average, which I call the "white" channel for the purposes of the following graph. The fat lines are the means. The skinny ones are the +/- two standard deviations. The red, green, and blue channels are colored appropriately. The average or white channel is colored black. I only averaged one of the green channels, and ignored the other.

(http://www.kasson.com/ll/D4RGBWZoneVIUnityGainISO.PNG)

It looks to me that it doesn't make a whole lot of difference what channel you pick. Some of the differences may be due to the color of the target, which was D65, more or less. With the D4, as with most cameras, that gives you a higher value in the green channels than in the red of blue ones.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 19, 2013, 01:23:15 pm
Thinking about this testing a bit more, I'm wondering how it relates to the concept of the 'ISO-less' sensor that people talked about, mostly, when the D7000/K5D came out.  The thought there was that it made no sense to increase ISO because of the essentially equal drop in drange for each 1 stop increase in ISO and that simply underexposing and pushing in the RAW converter would serve the same purpose.  The D800 sensor behaves much the same way yet it appears that it does make sense to increase ISO up to a point.  Is there conflict between the two schools of thought?

I don't think so. Above the Unity Gain ISO (or maybe a stop above that to make allowances for imperfect analog-to-digital converters), the camera is effectively ISO-less, and the ISO dial serves mainly for amusement of the photographer  and getting the preview image to be bright enough to use for chimping.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 19, 2013, 02:36:47 pm
Thanks.  Nice article.  Takes a technical concept and explains it such that an engineering degree isn't needed to decipher it.  Too rare an occurrence.  See the response directly above for the typical bit of bafflegarb.  ::)

One question.  Why only the G channel?  Why not the entire signal of the entire sensor?


Bob,

Sorry that you have limited technical comprehension beyond the 8th grade level and couldn't digest my post.

Bill
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 19, 2013, 02:45:13 pm
What is the purpose of knowing the Unity Gain ISO?  What practical purpose does it have?  Similarly what practical purpose does knowing the full well capacity have?  Are we able to use the information to determine exposure on the fly, in the field?

The "Real World" card has been played  ;)

The well-respected and knowledgeable Roger Clark seems to feel it has a practical purpose, at least in the comparison of camera performance:

http://www.clarkvision.com/articles/digital.sensor.performance.summary/#unity_gain

Ted the Noob
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 02:49:15 pm
I don't think so. Above the Unity Gain ISO (or maybe a stop above that to make allowances for imperfect analog-to-digital converters), the camera is effectively ISO-less, and the ISO dial serves mainly for amusement of the photographer  and getting the preview image to be bright enough to use for chimping.

Jim

I think that makes sense, and your results seem to be consistent with what DxOMark shows on their Dynamic Range plot for the D4.  

The plot for all 3 (or 4) colour channels is interesting too.  I think illuminant type could play a part there.  Perhaps, even if the illuminant is rated for a certain colour temperature, if it isn't full-spectrum that could make a difference.

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 19, 2013, 03:02:33 pm
The plot for all 3 (or 4) colour channels is interesting too.  I think illuminant type could play a part there.  Perhaps, even if the illuminant is rated for a certain colour temperature, if it isn't full-spectrum that could make a difference.

Bob,

Yes, but it's almost certainly a second- or third-order effect. In my testing, the calculated Unity Gain ISO is only weakly sensitive to the histogram mean. Since all the underlying sensor cells are statistically the same no matter what color filter in the CFA is over them, the effect of various illuminant spectra is to change the relative histogram means of the various color channels.

By the way, figuring out the details of this has dramatically changed the way I work in dim light. I use manual exposure almost all the time where I usually used aperture-preferred with adjustments to the exposure compensation dial. I use the histogram mainly to figure out how much noise I'm going to  have to deal with in the file. I leave the exposure the same for many pictures when before I would be constantly changing it. It feels very different to me.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 03:14:27 pm
The "Real World" card has been played  ;)

The well-respected and knowledgeable Roger Clark seems to feel it has a practical purpose, at least in the comparison of camera performance:

http://www.clarkvision.com/articles/digital.sensor.performance.summary/#unity_gain

Ted the Noob

And the problem with that is.....?  I wasn't saying that the concept of unity gain ISO isn't important.  But there are a lot of things that get studied in a lab that have little to no practical application (at least at this time).  Most of us aren't lab rats; however.  Most of us are 'in the field' photographers so it makes complete sense to understand how a given lab or theoretical test plays out in practical use.  As has been laid out over the course of this discussion there are, definitely, practical implications.  And the findings that Jim has laid out and explained are consistent with other, considered reliable, sources which simply lends increased credibility to both.  There's also something to be said for being able to explain a technical or theoretical construct and make it more widely understood.  Some are unable to do that because they don't really understand the underlying technicalities themselves.  Others won't do that because they think it gives them some measure of superiority over others, it makes them feel elite or special.  
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 03:17:58 pm

By the way, figuring out the details of this has dramatically changed the way I work in dim light. I use manual exposure almost all the time where I usually used aperture-preferred with adjustments to the exposure compensation dial. I use the histogram mainly to figure out how much noise I'm going to  have to deal with in the file. I leave the exposure the same for many pictures when before I would be constantly changing it. It feels very different to me.

Jim

I can definitely appreciate that.  It's not something I run into often but something I'm looking at more closely now with a D800 because it has an ISO/DRange curve shape that's very much linear; like the D7000.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 19, 2013, 04:13:51 pm
And the problem with that is.....?  I wasn't saying that the concept of unity gain ISO isn't important.  But there are a lot of things that get studied in a lab that have little to no practical application (at least at this time).  Most of us aren't lab rats; however.  Most of us are 'in the field' photographers so it makes complete sense to understand how a given lab or theoretical test plays out in practical use.  As has been laid out over the course of this discussion there are, definitely, practical implications.  And the findings that Jim has laid out and explained are consistent with other, considered reliable, sources which simply lends increased credibility to both.  There's also something to be said for being able to explain a technical or theoretical construct and make it more widely understood.  Some are unable to do that because they don't really understand the underlying technicalities themselves.  Others won't do that because they think it gives them some measure of superiority over others, it makes them feel elite or special.  

My response was to your earlier post:

Quote
What is the purpose of knowing the Unity Gain ISO?  What practical purpose does it have?  Similarly what practical purpose does knowing the full well capacity have?  Are we able to use the information to determine exposure on the fly, in the field?

The problem with that, if you must know, is:

A gentleman puts a lot of research and work into a post - which he publishes on what I thought was a forum where there is at least some slight interest in matters technical. Your quote immediately above decries the usefulness of the OP with a series of demeaning rhetorical questions. Your post offered nothing other than the negative implication that the OP is of no practical use. Effectively thereby, it dismissed the OP as useless.

The "Real World" card was played in the last line " . .  to determine exposure on the fly, in the field . . "

Perhaps the problem wasn't what was said, it was how it was said. And, I must confess to a certain sensitivity in the area of this topic. I once calculated the saturation-based "native" ISO of a Sigma DSLR sensor, posted it with formulae and quotes from the ISO standard on a Sigma forum, thinking it might be of interest, and was promptly beaten up for being too technical.

Ted
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Vladimirovich on March 19, 2013, 04:16:05 pm
Since all the underlying sensor cells are statistically the same no matter what color filter in the CFA is over them

but the processing by camera's hardware (including on chip/off chip ADCs)/firmware of the might not be the same
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 19, 2013, 06:12:54 pm
My response was to your earlier post:

The problem with that, if you must know, is:

A gentleman puts a lot of research and work into a post - which he publishes on what I thought was a forum where there is at least some slight interest in matters technical. Your quote immediately above decries the usefulness of the OP with a series of demeaning rhetorical questions. Your post offered nothing other than the negative implication that the OP is of no practical use. Effectively thereby, it dismissed the OP as useless.

The "Real World" card was played in the last line " . .  to determine exposure on the fly, in the field . . "

Perhaps the problem wasn't what was said, it was how it was said. And, I must confess to a certain sensitivity in the area of this topic. I once calculated the saturation-based "native" ISO of a Sigma DSLR sensor, posted it with formulae and quotes from the ISO standard on a Sigma forum, thinking it might be of interest, and was promptly beaten up for being too technical.

Ted


I suggest that your past experience is clouding your perception of the current situation.  I know full well what your initial response was in reference to.  My questions were not rhetorical, nor demeaning.  I didn't say his work was of no practical value.  I asked what it all meant in practical terms.  Because, as I noted, how or if theoretical constructs impact practical photography is of relevance.  Through the course of the thread, we've found out how Jim is using the information for practical purposes in his 'real world' photography.  How can that be anything but a positive?  I also indicated that I've been thinking about the related concept of the ISO-less sensor because I now have a camera that exhibits that trait.  As far as playing the 'real world' card, you still haven't answered my question of why that is unimportant.  Do you disagree with my reasons why it is important? 

I'll ask you the same question:  What practical application does your analysis of the native ISO of a Sigma sensor have?  How can photographers use the information in the field to advantage?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 19, 2013, 06:31:04 pm
but the processing by camera's hardware (including on chip/off chip ADCs)/firmware of the might not be the same

I'd never considered that possibility. Do cameras really have differential processing of the three (well, four) color planes of a raw file? If so, how can you find out if that's the case in a given camera? There's one case I have heard of, and that's multiplicative scaling of the values in a given color plane after the ADC, with the evidence being missing codes in that channel. Compression like Sony uses could, I suppose, cover up that evidence, or at least muddy the waters. I don't think such scaling would have much effect on the test results of the algorithm I'm proposing, unless the exposure gets really low, but I haven't done any testing, since I don't have a camera that I know does that kind of thing.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 19, 2013, 07:33:55 pm
As far as playing the 'real world' card, you still haven't answered my question of why that is unimportant.  Do you disagree with my reasons why it is important?

I guess not. I just didn't like those non-rhetorical, non-demeaning questions, when it comes right down to to it. Should have kept my opinion to myself, and I'll say no more about it if you won't.  

I'll ask you the same question:  What practical application does your analysis of the native ISO of a Sigma sensor have?  How can photographers use the information in the field to advantage?

I can answer without really going OT. I will assume that we are familiar with ISO 12232: 2006. It gives several legal methods of determining a value to be shown or selected on a camera. Some of the methods allow the camera [manufacturer] considerable latitude in these values, provide the word "equivalent" appears somewhere in the product, perhaps buried deep in the manual. And some manufacturers are said to take liberties even with that, according to fora elsewhere. On the camera itself, of course, we will only see 'ISO' unless anyone knows of a camera which says 'SOS' or 'REI' right there on the LCD or knob or whatever. Thus we are lulled into thinking that a setting of 100 gives exactly the same exposure for any camera (all other things being equal).

It is possible to calculate or, for that matter, test as per the OP to determine a sensors saturation-based ISO value (Ssat) - independently of what the camera says. If you then know (up front) how much over or under your camera is, you can dial in exposure compensation such that the camera 'tells the truth' which would be of practical benefit to those seeking, for example, to ETTR. Or those whose images come out less exposed or more exposed than they would like. Or those who want to push the envelope a bit, hoping to claw back some highlight details in post.

I would say that is both useful and practical to know that a camera has an Ssat of, say 130, when the LCD 'ISO' says 100. Feel free to disagree.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: eronald on March 19, 2013, 09:24:42 pm
I'd never considered that possibility. Do cameras really have differential processing of the three (well, four) color planes of a raw file? If so, how can you find out if that's the case in a given camera? There's one case I have heard of, and that's multiplicative scaling of the values in a given color plane after the ADC, with the evidence being missing codes in that channel. Compression like Sony uses could, I suppose, cover up that evidence, or at least muddy the waters. I don't think such scaling would have much effect on the test results of the algorithm I'm proposing, unless the exposure gets really low, but I haven't done any testing, since I don't have a camera that I know does that kind of thing.

Jim

I think Iliah knows all about this scaling. It is present in Nikons.

Edmund
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 20, 2013, 07:49:32 am
I can answer without really going OT. I will assume that we are familiar with ISO 12232: 2006. It gives several legal methods of determining a value to be shown or selected on a camera. Some of the methods allow the camera considerable latitude in these values, provide the word "equivalent" appears somewhere in the product, perhaps buried deep in the manual. And some manufacturers are said to take liberties even with that, according to fora elsewhere. On the camera itself, of course, we will only see 'ISO' unless anyone knows of a camera which says 'SOS' or 'REI' right there on the LCD or knob or whatever. Thus we are lulled into thinking that a setting of 100 gives exactly the same exposure for any camera (all other things being equal).

It is possible to calculate or, for that matter, test as per the OP to determine a sensors saturation-based ISO value (Ssat) - independently of what the camera says. If you then know (up front) how much over or under your camera is, you can dial in exposure compensation such that the camera 'tells the truth' which would be of practical benefit to those seeking, for example, to ETTR. Or those whose images come out less exposed or more exposed than they would like. Or those who want to push the envelope a bit, hoping to claw back some highlight details in post.

I would say that is both useful and practical to know that a camera has an Ssat of, say 130, when the LCD 'ISO' says 100. Feel free to disagree.

I would say that you're doing something that people have done for decades.  That is, essentially, verifying the accuracy of the exposure system in the camera?  How are you isolating ISO from the other components of the exposure?  What you're effectively doing, it seems, is verifying the accuracy of the metering system.  Or are you using a hand held meter to determine exposure?  If the latter, then back to the earlier question of how you're separating ISO from shutter speed and aperture.  How do your figures compare with DxO's?  And how would you account for any differences between your numbers and theirs?  How are you determining that 'saturation-based ISO'?  What is the methodology?  While I understand the practical relevance of what you're doing, it still raises many questions.  And dressing it up in pseudo-buzzwords like Ssat, or even 'saturation-based ISO', as opposed to something like 'the point at which overexposure occurs' is going to turn some people off.  This is back to the point I made yesterday.  There is something to be said for being able to explain technical constructs in a way that they are more widely understood.  The more people who understand, the better it is for everyone, no?  The more people who understand, the more it can foster discussion.  Can you explain your methodology in such a way?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 20, 2013, 09:14:18 am
What you're effectively doing, it seems, is verifying the accuracy of the metering system.  Or are you using a hand held meter to determine exposure?  If the latter, then back to the earlier question of how you're separating ISO from shutter speed and aperture. 

No, in most cases you are verifying the rating of the sensor. In assigning an ISO to the sensor, manufacturers allow widely differing amounts of headroom for the highlights, and this is the major variable. Light meters are fairly well standardized according to ISO 2720:1974. My personal experience is with Nikon, and their meters are usually spot on. Otherwise, the use of a hand held meter would give different results from the built in meter. These considerations are discussed in depth in articles by Doug Kerr on his web site.

How do your figures compare with DxO's?  And how would you account for any differences between your numbers and theirs?  How are you determining that 'saturation-based ISO'?  What is the methodology?  While I understand the practical relevance of what you're doing, it still raises many questions.  And dressing it up in pseudo-buzzwords like Ssat, or even 'saturation-based ISO', as opposed to something like 'the point at which overexposure occurs' is going to turn some people off.  This is back to the point I made yesterday.  There is something to be said for being able to explain technical constructs in a way that they are more widely understood.  The more people who understand, the better it is for everyone, no?  The more people who understand, the more it can foster discussion.  Can you explain your methodology in such a way?

The DXO saturation standard (http://www.dxomark.com/index.php/About/In-depth-measurements/Measurements/ISO-sensitivity) is straight forward:

Ssat = 78·A2/q·Lsat·t,

where A is the aperture, q is a constant, Lsat is the luminance in cd/m2 required for saturation, and t is the integration time (shutter speed). On modern digital cameras the apertures and shutter speeds are quite accurate. Most photographers do not have a photometer to measure the luminance, but as mentioned above, the camera meters are usually within spec and the meter reading can be used with confidence. An exposure according to the saturation standard should yield approximately 12.7% sensor saturation, and this is easy to verify using RawDigger or a similar tool. Why complicate things and throw up all your disclaimers?

Regards,

Bill
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 20, 2013, 10:39:02 am
No, in most cases you are verifying the rating of the sensor. In assigning an ISO to the sensor, manufacturers allow widely differing amounts of headroom for the highlights, and this is the major variable. Light meters are fairly well standardized according to ISO 2720:1974. My personal experience is with Nikon, and their meters are usually spot on. Otherwise, the use of a hand held meter would give different results from the built in meter. These considerations are discussed in depth in articles by Doug Kerr on his web site.

This can happen.  It's not uncommon.  You automatically assume that people know who Doug Kerr is?  This is more of the same obfuscation.  But just so we're all sure, I'm guessing this (http://dougkerr.net/pumpkin/index.htm) is the Doug Kerr you're referring to.  This is an excerpt from a comment he made on another forum a number of years ago: "I shoot mostly in P, beacuse [sic] in most cases I can't imagine what I know about scene brightness metering and setting exposure parameters that 300 engineers in Japan don't."  Not a source of information I'd put a great deal of confidence in.  

Quote
The DXO saturation standard (http://www.dxomark.com/index.php/About/In-depth-measurements/Measurements/ISO-sensitivity) is straight forward:

Ssat = 78·A2/q·Lsat·t,

where A is the aperture, q is a constant, Lsat is the luminance in cd/m2 required for saturation, and t is the integration time (shutter speed). On modern digital cameras the apertures and shutter speeds are quite accurate.

Actually not as accurate as you might think.  'Aperture flicker' is a big annoyance to timelapse shooters and it can make a significant difference from shot to shot in a clip.  And yes, I can go and read the articles on the DxO site.  But from his explanation I have no idea whether Ted is using the same methodology or not.  So I asked.  'q' is a 'constant'?  What is it?  What constant?  What's the figure?  It really isn't a true 'constant' though, is it?  It's going to vary from lens to lens, right?  Where do the T and v values come from in determining q?  If I ask why '78'?  Or where that number comes from you'll decry that I'm throwing up roadblocks.  When in actual fact that's not the case at all. Understanding how a formula is derived or where the inputs come from is as important as just plugging numbers into it.  


Quote
Most photographers do not have a photometer to measure the luminance, but as mentioned above, the camera meters are usually within spec and the meter reading can be used with confidence. An exposure according to the saturation standard should yield approximately 12.7% sensor saturation, and this is easy to verify using RawDigger or a similar tool. Why complicate things and throw up all your disclaimers?

Regards,

Bill

I'm not complicating things.  I'm trying to simplify, get past the bafflegarb and get to the heart of the matter.  That you see my questions as 'disclaimers' is your problem.  
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 20, 2013, 11:26:57 am
Actually not as accurate as you might think.  'Aperture flicker' is a big annoyance to timelapse shooters and it can make a significant difference from shot to shot in a clip.  

Do you have any data on this? I do have data for the Nikon D800e using various shutter speeds and a constant aperture of f/8. The coefficient of variation is 1.0, indicating a high degree of reproducibility for both the aperture and the shutter speed.

(http://bjanes.smugmug.com/Photography/Sensor-Analysis/D800e-Sensor/i-44xgZ5s/0/O/LogLogDNvsExp.png)

And yes, I can go and read the articles on the DxO site.  But from his explanation I have no idea whether Ted is using the same methodology or not.  So I asked.  'q' is a 'constant'?  What is it?  What constant?  What's the figure?  It really isn't a true 'constant' though, is it?  It's going to vary from lens to lens, right?  Where do the T and v values come from in determining q?  If I ask why '78'?  Or where that number comes from you'll decry that I'm throwing up roadblocks.  When in actual fact that's not the case at all. Understanding how a formula is derived or where the inputs come from is as important as just plugging numbers into it.  

It would be good if you did a bit of reading before asking questions about data that are readily available and understood by photographers with a technical bent. The derivation of 78 is addressed along with other issues in an excellent post (http://en.wikipedia.org/wiki/Film_speed#Saturation-based_speed) on Wikipedia. The factors in determining q are also discussed and they do include an assumed T value for the lens. With TTL metering, the T factor is taken into account. For practical photography, one is really interested in the total system response that includes the lens, sensor, light meter, exposure mechanism of the camera, and the rendering software.

Regards,

Bill
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 20, 2013, 11:55:26 am
Do you have any data on this? I do have data for the Nikon D800e using various shutter speeds and a constant aperture of f/8. The coefficient of variation is 1.0, indicating a high degree of reproducibility for both the aperture and the shutter speed.

I, and many others who do timelapse, have ample empirical evidence.  That empirical evidence is supported by methods used to eliminate the problem.  Photography isn't all about data.  It's about results more importantly.

(http://bjanes.smugmug.com/Photography/Sensor-Analysis/D800e-Sensor/i-44xgZ5s/0/O/LogLogDNvsExp.png)

Quote
It would be good if you did a bit of reading before asking questions about data that are readily available and understood by photographers with a technical bent. The derivation of 78 is addressed along with other issues in an excellent post (http://en.wikipedia.org/wiki/Film_speed#Saturation-based_speed) on Wikipedia. The factors in determining q are also discussed and they do include an assumed T value for the lens. With TTL metering, the T factor is taken into account. For practical photography, one is really interested in the total system response that includes the lens, sensor, light meter, exposure mechanism of the camera, and the rendering software.

Regards,

Bill

Why?  I read something someone posts that raises questions in my mind.  What is so wrong about asking questions.  What are you afraid of?  Why are you staunchly opposed to questions?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: RFPhotography on March 20, 2013, 11:57:34 am
Those "pseudo-buzzwords" come from the ISO standard.

I'm through talking to you, Bob.

Thank you for making my point.  The lexicon comes from a highly technical document.  It's intended to be read by people with a highly technical background.  Here's the thing.  Not everyone has that highly technical background.  Read what I noted earlier about the (rare) ability to translate technical constructs into more easily understood text.  If you had done that, perhaps people wouldn't have responded so, according to you, harshly.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 20, 2013, 02:35:08 pm
At the 16 bit DN of about 16000, the SD is contaminated by PRNU. The observed SD is 156 and the corrected SD is 144. At a 16 bit DN of around 4000, the observed SD is 73.8 and the corrected SD is 72.3.

Bill,

I started down the road of creating a model in Excel to help me sort this out. It got messy fast, because a few hundred pixels in a simulated test image is not enough to have stable expected values (I'm using the term in the mathematical sense). I've decided that what I should do is create a camera model using a real programming language. I've decided on Matlab. If I do it right, I should be able to extend it to aliasing and demosaicing studies. This is not going to be an afternoon job, so be patient.

One thing I could use is information that would help me model pixel response non-uniformity. I'd be grateful for any pointers you might give me.

Thanks,

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 20, 2013, 10:47:54 pm
Bill,

I started down the road of creating a model in Excel to help me sort this out. It got messy fast, because a few hundred pixels in a simulated test image is not enough to have stable expected values (I'm using the term in the mathematical sense). I've decided that what I should do is create a camera model using a real programming language. I've decided on Matlab. If I do it right, I should be able to extend it to aliasing and demosaicing studies. This is not going to be an afternoon job, so be patient.

One thing I could use is information that would help me model pixel response non-uniformity. I'd be grateful for any pointers you might give me.

Jim,

The best answer I can give for determining PRNU is that PNRU is proportional to the signal, so it increases along with shot noise as exposure increases. Unless you are doing exposures over 1 second or so, you can probably ignore thermal noise. Once you have determined the shot noise from duplicate exposures, PRNU can be estimated by subtracting in quadrature the shot noise and read noise (which is not significant at higher exposures) from the total noise. Have you seen the excellent treatise (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/index.html) on noise by Emil Martinec? If not, it is worth reading. I presume that you have read Roger Clark's post (http://www.clarkvision.com/imagedetail/evaluation-1d2/index.html) on sensor analysis for the Canon 1DM2. It also has good information.

Again, thanks for taking the trouble to perform and write up your excellent investigations and let us know what you find in future tests.

Regards,

Bill

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Fine_Art on March 20, 2013, 11:01:39 pm
The full-well capacity is a pretty darned good indicator of the dynamic range of the camera. It's a nice thing to know when you're trying to decide what camera to buy, or what camera to use for a particular job.

Once you've purchased the camera and are using it, you might use the dynamic range of the camera to determine when you need to use HDR, averaging, or similar techniques to get more shadow detail. You can't do that directly from the full-well capacity, but you could take the log base 2 of the full-well capacity, and subtract 4 to 7 stops (some people say you need 100 electrons for photographic quality, and that's a tad under two to the seventh) to account for the signal-to-noise ratio (SNR) you want in the shadows, and what's left would be the approximate difference, in stops, between the highlights and the shadows-with-detail (Zone II or III).

Here's the graph with a log base 2 vertical axis to make it easy for you to do the math in your head:

(http://www.kasson.com/ll/FWstops.PNG)

This ignores dark noise, read noise, and other things that affect the shadows but not the light tones. It also ignores resolution, and you can decrease noise in an image by rezzing it down. In practice, I've found the D4 and the D800 to give similar noise performance at similar resolutions. If we compute the dynamic range by averaging the photosites to get to 12 megapixels for each camera, we see that, except for the M9, the size of the sensor pretty much detirmines the dynamic range:

(http://www.kasson.com/ll/FWstops-rescor.PNG)

Jim

I find both of these charts very interesting, thanks.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 20, 2013, 11:30:44 pm
The best answer I can give for determining PRNU is that PNRU is proportional to the signal, so it increases along with shot noise as exposure increases.

Bill,

I'm slow, but I get there eventually: PRNU proportional to signal, photon noise proportional to the square root of the signal. Therefore PRNU more important at high signals. Got it, finally.


Have you seen the excellent treatise (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/index.html) on noise by Emil Martinec? If not, it is worth reading.

I have seen it, but I initially thought that I could do a black-box analysis. I now see that's not going to work very well, and I need to peek beneath the covers. My worry is that, as I find out more about the underlying processes, that the model will need to have a bunch of special cases (look at the way the M9 results are outliers), and that it will turn into something as Byzantine as pre-Copernican astronomy, to mix a few metaphors.

If somebody has attempted this before me, and they have a class hierarchy that they're happy with, it would save me from reinventing the wheel. I would hope that classes and methods should in this case be substantially  independent of programming language (assuming OOP).

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 24, 2013, 03:08:51 pm
Bill (and anyone else who still cares),

I created a camera model in Matlab. I modeled pixel response non-uniformity (PRNU) by creating a matrix the same size as the image, populating that matrix with a normal distribution centered around unity, and, for each simulated exposure, multiplying the electron count (including photon noise) by the matrix. Then I made 100 simulated exposures, took the central 200x200 pixels, and computed the Unity Gain ISO using the algorithm in the OP. I did that for test ISOs from 100 to 6400, and for exposures from Zone VII (ADC value of 8000) to Zone III (ADC value of 500). Here's what I got:

(http://www.kasson.com/ll/D4SimNoReadNoise.PNG)

Here are the parameters of the camera that I simulated, which was modeled loosely on the Nikon D4. Full well of 100,000 electrons. Base ISO 100. Fourteen bit ADC. (those three parameters taken together work out to a UG ISO of 610.39.) PRNU standard deviation of 0.002. Quantum efficiency of one. I have not yet modeled read or dark noise, which will probably keep the Zone III line from looking as good as it does in this set of curves.

So, you were right about cutting down the exposure when you're using this algorithm to compute Unity Gain ISO.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: eronald on March 24, 2013, 03:14:28 pm
Deleted original content - sorry.

BTW, all current sensors seem to have tunable anti-blooming incurving their response near saturation.


Edmund
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 24, 2013, 03:30:26 pm
BTW, all current sensors seem to have tunable anti-blooming incurving their response near saturation.

If you can get me details, I can throw it into the model. So far, I haven't modeled what happens when a well overflows. In the present model, it just clips.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 24, 2013, 04:40:36 pm
Bill,

I've added read/dark noise to the model. I've assumed it's Gaussian, although it seems to have longer tails than that. I got the values from some Nikon D4 testing I've done with exposures at 1/30 of a second (therefore not much dark current). I made the exposures using ISOs from 100 to 6400, and, to the first order, the noise all occurs before the pre-ADC amplifiers. The mean value of the noise with an amplifier gain of unity is 1.8 least-significant bits (LSBs) and the standard deviation is 2.7 LSBs. Since I did my testing with the lens cap on, values below zero got clipped, and therefore the real standard deviation is probably higher. I note that observation, but have not tried to correct for it. Because the real read noise tail appears longer than Gaussian and the standard deviation is probably understated, the curve that follows could be optimistic in the higher test ISOs and the darker targets.

Here's the result:

(http://www.kasson.com/ll/D4SimReadNoise.PNG)

You can see that the best compromise exposure is Zone IV (14-bit ADC count of 1000), exactly as you predicted.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 25, 2013, 01:59:05 pm
I've added read/dark noise to the model. I've assumed it's Gaussian, although it seems to have longer tails than that. I got the values from some Nikon D4 testing I've done with exposures at 1/30 of a second (therefore not much dark current). I made the exposures using ISOs from 100 to 6400, and, to the first order, the noise all occurs before the pre-ADC amplifiers. The mean value of the noise with an amplifier gain of unity is 1.8 least-significant bits (LSBs) and the standard deviation is 2.7 LSBs. Since I did my testing with the lens cap on, values below zero got clipped, and therefore the real standard deviation is probably higher. I note that observation, but have not tried to correct for it. Because the real read noise tail appears longer than Gaussian and the standard deviation is probably understated, the curve that follows could be optimistic in the higher test ISOs and the darker targets.
can see that the best compromise exposure is Zone IV (14-bit ADC count of 1000), exactly as you predicted.

Hi Jim, very nice.  I trust you know that the source of empirical knowledge about noise and similia in DSCs is this excellent treatise by Emil Martinec (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p2.html#readandshot).

For fun, I applied the theory there to the full SNR curves that can be found at DxO (http://www.dxomark.com).  Here is an example based on the D5200:

(http://g3.img-dpreview.com/8FF31FDD83C74CE1A3C02FE63B802273.jpg)

It's amazing what information one can pull out of those little graphs.  Here is an example on the D800e, which I don't think has been characterized by Sensorgen (http://www.sensorgen.info/NikonD800.html) yet.  Blue data is read off the chart, green values is the analysis that comes out of it.  My results are typically very, very similar to Sensorgen's - as well they should, we are using the same data.

(http://i.imgur.com/MnraIQ5.jpg)

Values up to ISO 6400 should be fairly accurate.  Above that I am not sure we get a clear spot where to rest the shot noise only/Signal tangent.

Cheers,
Jack

PS Just out of curiosity, why do you refer to Zones when talking about Raw value ranges?  If you want to start an interesting debate try asking where Zone 0 should sit out of full scale and watch what happens  :)
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 25, 2013, 02:35:55 pm
Anyway, here goes. On the RawDigger site, there's a technique for computing Unity Gain ISO (http://www.rawdigger.com/howtouse/pixel-capacity-and-amplifier-gain). It is basically a search over several exposures made with the camera ISO setting at different places for the ISO setting that, with a flat, relatively bright (but not saturated) compact target rectangle, produces a standard deviation in the (pick a channel) raw values that's the square root of the mean raw value in that channel.

I have often wondered what 'unity' means exactly.  I understand it in principle (input 100 apples, count 100), but does it really apply to the statistical nature of light, where integers are replaced by means and standard deviations with many decimal points?

So what's the input: photons or electrons?  Most of the relevant posts in this thread assume electrons.  Why?  From my D800e chart above it takes about 6.4 photons on top of the sensor to generate an electron. That's not an integer to start with.  And what happens if I only get 6 photons? Do I get an electron?  I believe I in fact get 0.94 electrons, which with a little dithering I can store pretty accurately in the Raw data.

Any thoughts?

Jack

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 25, 2013, 03:09:16 pm
I have often wondered what 'unity' means exactly.

Jack,

It's sloppy notation, but I use it because of its wide currency. The denominator is electrons, the way that I think of it. That way the shot noise varies as the square root of the signal. If 1000 photons fall on a photosite and 500 electrons are generated, the shot noise is the same as if 500 photons fell on the site of a different, ideal, camera and 500 electrons were generated. I call the shot noise photon noise, although it is really electron noise, because that's the notation I see so often. I think it's sufficiently clear in context.

In electrical engineering, gain is usually a unitless quantity. Volts out over volts in. Amps out over amps in. However, in this usage, it has units: counts out over electrons in. That makes me cringe, but it seems to be standard usage, so I go along.

I am more comfortable dealing with statistical uncertainty in digital data streams, and in the physical events upstream. I worked for Hewlett-Packard designing data acquisition and process control systems, and for Rolm and IBM designing voice and data communication systems, and noisy data is something that nearly always is what you have to work with. In fact, one of the patents that made the first Rolm CBX possible involved injecting spectrally-shaped noise into the ADC to, in effect, gain a thirteenth bit in a 12-bit ADC. I came up with the idea in a moment of desperation after we decided to go after the telco market, which had more stringent noise and crosstalk standards. It was later picked up by the audio industry in general, and used in the Compact Disc. But I digress. I'm fine with data being stochastic, just like analog signals.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 25, 2013, 03:19:05 pm
Just out of curiosity, why do you refer to Zones when talking about Raw value ranges?

I started using the notation when working with local (Monterey Peninsula) photographers. Out here, it seems like the Zone System is in the water, and everyone seems to know what I'm talking about. It doesn't bear close scrutiny, because the Zones in the Zone System are in the manipulated output, and I mean to refer to light ratios in the signal that falls on the sensor.

What I wanted when I fastened on the Zone nomenclature was a term that indicated the digitized value in a raw file  independent of the number of bits in the ADC and the gain of the amplifier. I also wanted it to be logarithmic, with a base of two, because we photographers think in terms of stops. Another possibility would be mean digitized value in stops below full scale, but around here I get some glazed eyes when I say that.

I am open to suggestions.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 25, 2013, 03:37:22 pm
Hi Jim, very nice.  I trust you know that the source of empirical knowledge about noise and similia in DSCs is this excellent treatise by Emil Martinec (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p2.html#readandshot).

Jack, I stand on the shoulders of others, and Emil has big shoulders.


For fun, I applied the theory there to the full SNR curves that can be found at DxO (http://www.dxomark.com).  Here is an example based on the D5200:

I like what you've done. Looking at your curves and some of my own data makes me want to extend my model to have two sources of read noise.

The first one is before the amplifier, measured in electrons. That noise would be specified as the characteristics of some probability density function. If I continue to use a Gaussian function, as I will for at least a while, the parameters will be mean and standard deviation. I kind of like the idea of quantizing the noise to integral numbers of electrons just for elegance, but I can't imagine that it will make any difference when averaged over a hundred exposures, which is my standard now (when I start running batch jobs, I'll probably raise that to a thousand). [Edit: now that I think about it, the noise added shouldn't be quantized, since it's electrical, but not necessarily electrons in the well. Maybe the electrons in the well should be rounded to the nearest integer, though.]

The second one would be after the amplifier, measured in LSBs, probably represented by the mean and standard deviation of a Gaussian generator, and probably not quantized to integers, because I see it as an analog signal injected into the ADC input.

One way to get these values would be to measure the noise at a bunch of ISOs and fit a straight line to the data. For some reason, I like that better than just having a different mean and standard deviation for each ISO, although the cruder technique is probably more accurate, since it allows for unmodeled mechanisms.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 25, 2013, 09:19:32 pm
Bill,

I've added read/dark noise to the model. I've assumed it's Gaussian, although it seems to have longer tails than that. I got the values from some Nikon D4 testing I've done with exposures at 1/30 of a second (therefore not much dark current). I made the exposures using ISOs from 100 to 6400, and, to the first order, the noise all occurs before the pre-ADC amplifiers. The mean value of the noise with an amplifier gain of unity is 1.8 least-significant bits (LSBs) and the standard deviation is 2.7 LSBs. Since I did my testing with the lens cap on, values below zero got clipped, and therefore the real standard deviation is probably higher. I note that observation, but have not tried to correct for it. Because the real read noise tail appears longer than Gaussian and the standard deviation is probably understated, the curve that follows could be optimistic in the higher test ISOs and the darker targets.

Here's the result:

(http://www.kasson.com/ll/D4SimReadNoise.PNG)

You can see that the best compromise exposure is Zone IV (14-bit ADC count of 1000), exactly as you predicted.

Jim

Jim,

Thank you! Your data are quite interesting and your model seems quite sophisticated. Matlab is above my pay grade :). I'm not sure how you took PRNU into account. In my testing with the D800e it represents about 0.38% of the signal output. Is that consistent with your model?

Regards,

Bill
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 25, 2013, 09:23:52 pm
I have often wondered what 'unity' means exactly.  I understand it in principle (input 100 apples, count 100), but does it really apply to the statistical nature of light, where integers are replaced by means and standard deviations with many decimal points?

So what's the input: photons or electrons?  Most of the relevant posts in this thread assume electrons.  Why?  From my D800e chart above it takes about 6.4 photons on top of the sensor to generate an electron. That's not an integer to start with.  And what happens if I only get 6 photons? Do I get an electron?  I believe I in fact get 0.94 electrons, which with a little dithering I can store pretty accurately in the Raw data.

Any thoughts?

Jack

Here is a link (http://www.clarkvision.com/articles/digital.sensor.performance.summary/#unity_gain) to what Roger Clark thinks about unity gain.

Regards,

Bill


Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 25, 2013, 09:38:54 pm
Jack, I stand on the shoulders of others, and Emil has big shoulders.

Indeed. Another source worth looking at is modeling work done by Marianne Oelund (http://actionphotosbymarianne.com/Tech/Optsim/index.html). I have not used her program but it looks interesting and might give you some ideas.

Regards,

Bill
Title: Computing Unity Gain ISO from a single exposure
Post by: BJL on March 25, 2013, 10:43:14 pm
It turns out that you can take the same data and compute full-well capacity, if you assume that the well fills as the ADC output approaches full-scale at base ISO. The full-well capacity should be proportional to photosite area, all else being equal. With the CCD-based Leica M9 in the mix, all else is not equal:

(http://www.kasson.com/ll/Fullwell.PNG)

Jim
Something seems wrong here: the M9 sensor should have roughly the same 60,000 electron full well capacity as other Kodak full frame type sensors with 6.8 micron pixels, like the KAF-31600: http://www.truesenseimaging.com/all/download/file?fid=11.62
so that 30,000 seems too low. Also, the other numbers seem too high, and it would be puzzling for full frame type CCDs to have lower rather that higher full well capacity, since the main virtue of full frame type sensors is using almost all of the sensor area for storing photo-electrons, whereas CMOS sensor use some space for the three or more processing transistors per photo-site.

Also, sensors like these with microlenses are known to hav quantum efficiency of around 40% or better with color filter arrays and higher without: about 80%. That is, about 2.5 photons per photo-electron with CFA, under 2 photons/electron without. So 6.2 photons per photo-electron is way to high.

Also, understand that it is not a matter of the sensor counting up to some number of photons and then scoring one electron; it is instead a probabilistic thing. For example, when a sensor has 80% quantum efficiency with no CFA in place, it means that each photon has an 80% chance of causing an electron to be deposited in the well, a 20% chance of going undetected.

P. S. the name "unity gain" is a bit unfortunate, as it perpetuates the myth that there is "no amplification" at some natural exposure index level, and "amplification" at all higher EI settings. Instead with various dimensional conversions from photo-electron counts (charges) to currents to voltages to numerical ADC levels, the idea of "unamplified" or "gain of one" is physically meaningless. I suppose the idea of "one ADC level per detected photon" can be useful, as an upper limit on the level of amplification that can help with image quality, SNR and such.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: joofa on March 25, 2013, 11:03:29 pm
So what's the input: photons or electrons?  Most of the relevant posts in this thread assume electrons.  Why?  

Electrons; because, in most of the such experiments one does not have access to photons. ADU/electrons is only what one has. So one just spectulates about photons. And, unfortunately, the calculation from photons going on to electrons and electrons going on to photons is not symmetric for the "usual analysis". More below.

Quote
From my D800e chart above it takes about 6.4 photons on top of the sensor to generate an electron. That's not an integer to start with.  And what happens if I only get 6 photons? Do I get an electron?  

Yes, you may get an electron with 6 photons in this case. However, here is that asymmetry: Using the numbers in your char above, if 20 photons fall on a pixels and QE is 15.7% percent, then, a good guess of the number of electrons generated is 20*0.157 = 3 electrons (rounded). However, if you see 3 electrons in your analysis then the number of photons impinged obtained as 3 / 0.157 = 19 electrons is a relatively poor guess (about 6 times off than the "best" guess on average).

Please see these links:

http://forums.dpreview.com/forums/post/50345602 (http://forums.dpreview.com/forums/post/50345602)
http://forums.dpreview.com/forums/post/50352414 (http://forums.dpreview.com/forums/post/50352414)
http://forums.dpreview.com/forums/post/50345857 (http://forums.dpreview.com/forums/post/50345857)

Joofa
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 26, 2013, 03:41:14 am
A little off-topic but, thanks to this thread, I've finally figured out how Clark calculates his Unity Gain ISO value (he doesn't actually give a formula in the link below, just a hint or two).

http://www.clarkvision.com/articles/digital.sensor.performance.summary/#unity_gain (http://www.clarkvision.com/articles/digital.sensor.performance.summary/#unity_gain)

He divides the sensor full well capacity by the ADC 'capacity' giving, say, a value of 'n'. Then log10(n)/log10(2) gives an exponent, say 'y'. Then the Unity Gain ISO is given by (base ISO) * 2^(y). So, for my SD10 with a well capacity of 77,000-e, a 12-bit converter and a base ISO of 100, that is 77,000/4095 =  n = 18.8. Then log10(18.8)/log10(2) = y = 4.233. Then Unity Gain ISO = 100 * 2^(4.233) = ISO 1880, voila!

By this method, it becomes unnecessary to know the sensor output characteristic uV/-e, the amplifier gain and the ADC input voltage range.

Of course, Sigma muddies the water a bit by recommending a lower figure than 77,000-e for good linearity . . . just as ISO themselves muddy the water with their inclusion of 'headroom' into the saturation-based ISO calculation.

Ted
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 04:20:49 am
Here is a link to what Roger Clark thinks about unity gain.

Ok Jim, Bill, Edmund, BJL, Ted, Joofa and everybody else - what Roger Clark says offers a good example of what I am asking:

"Since 1 electron (1 converted photon) is the smallest quantum that makes sense to digitize, there is little point in increasing ISO above the Unity Gain ISO (small gains may be realized due to quantization effects, but as ISO is increased, dynamic range decreases)"

1. One electron is not one converted photon...
2. Even if it were, isn't he assuming that the electron is either there or not there when he says that it is "the smallest quantum that makes sense do digitize"?  Doesn't quantum mechanics work in double precision floating point internally  ;)?
3. I can think of many ways to determine when to stop increasing ISO, but all of them include some measure of read noise, which I do not see here.

Please correct me if I am reading this wrong but, intuitively, an electron is just the equivalent of a convenient SI unit.  However it means nothing by itself:  we cannot tell if that one electron is the signal (a mean) or noise.  In order to decode the signal we need a larger sample.  Because there will be (random) noise, we also get dithering.  Which, depending on sample and noise size, may allow us to determine the 'signal' to many significant digits, for example 0.15 electrons.  So does it make sense to speak of 1 electron (or was it photon?) as "the smallest quantum that it makes sense to digitize"?

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 04:33:03 am
I'm not sure how you took PRNU into account. In my testing with the D800e it represents about 0.38% of the signal output.

It's consistent with the data that comes off of the DxO curves at ISO 200 and 400 for which I get 0.36% and 0.39% at ISO 200 and 400 respectively in the table above.  I am not sure why ISO 100 is inconsistent at 0.28% - in theory this should give the most accurate reading - perhaps a slight measurement error on my part.  For your reference, the D800's PRNU readings in the 100 to 400 ISO range were virtually identical.

Jack
[EDIT] Rereading this message it is unclear: identical to each other, not to the D800e's.  PRNU on the D800 came out to 0.51%, 0.53%, 0.52% at ISO 100, 200, and 400 resp.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 04:53:20 am
Looking at your curves and some of my own data makes me want to extend my model to have two sources of read noise.

The first one is before the amplifier, measured in electrons. That noise would be specified as the characteristics of some probability density function. If I continue to use a Gaussian function, as I will for at least a while, the parameters will be mean and standard deviation...
The second one would be after the amplifier, measured in LSBs, probably represented by the mean and standard deviation of a Gaussian generator, and probably not quantized to integers, because I see it as an analog signal injected into the ADC input.

One way to get these values would be to measure the noise at a bunch of ISOs and fit a straight line to the data. For some reason, I like that better than just having a different mean and standard deviation for each ISO, although the cruder technique is probably more accurate, since it allows for unmodeled mechanisms.

Great, I'm curious to see whether it makes a material difference, or whether the simpler model we've been using suffices for our purposes.  You may want to take a look at the links that Joofa provided to help you choose the appropriate functions.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 05:19:15 am
What I wanted when I fastened on the Zone nomenclature was a term that indicated the digitized value in a raw file  independent of the number of bits in the ADC and the gain of the amplifier. I also wanted it to be logarithmic, with a base of two, because we photographers think in terms of stops. Another possibility would be mean digitized value in stops below full scale, but around here I get some glazed eyes when I say that.

I am open to suggestions.

My question about Zones refers to the fact that no two cameras/vendors meter to roughly the same spot in the Raw data, therefore when Zone IV is mentioned one is not sure what to refer it to - hence the need to refer to a specific Raw Value (i.e. 1000).  Metering as set up by different vendors seems to fall in the -3 to -4.5 stops from saturation range (12.5-5% of Raw full scale).  Ansel Adams would have been happier with the latter, absent bracketing  ;)

So one way to specify the signal in log 2 fashion familiar to photographers would be as a function of Stops from Clipping.  Another way I've seen it (as in RawDigger) is to assign O EV to 12.5% (as per the relative ISO Saturation Speed standard).  This way Saturation is +3 EV and everything else falls into place.

A third way, apparently intuitive but potentially misleading in the long run, is for the x axis to refer to the camera's Raw values in log2 notation: saturation is about 14, one stop lower is 13 etc.  But this approach is bit depth dependent and, worse, tempts readers to tie together bit-depth and dynamic range.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 26, 2013, 05:30:22 am
Ok Jim, Bill, Edmund, BJL, Ted, Joofa and everybody else - what Roger Clark says offers a good example of what I am asking:

"Since 1 electron (1 converted photon) is the smallest quantum that makes sense to digitize, there is little point in increasing ISO above the Unity Gain ISO (small gains may be realized due to quantization effects, but as ISO is increased, dynamic range decreases)"

1. One electron is not one converted photon...
2. Even if it were, isn't he assuming that the electron is either there or not there when he says that it is "the smallest quantum that makes sense do digitize"?  Doesn't quantum mechanics work in double precision floating point internally  ;)?
3. I can think of many ways to determine when to stop increasing ISO, but all of them include some measure of read noise, which I do not see here.

Please correct me if I am reading this wrong but, intuitively, an electron is just the equivalent of a convenient SI unit.  However it means nothing by itself:  we cannot tell if that one electron is the signal (a mean) or noise.  In order to decode the signal we need a larger sample.  Because there will be (random) noise, we also get dithering.  Which, depending on sample and noise size, may allow us to determine the 'signal' to many significant digits, for example 0.15 electrons.  So does it make sense to speak of 1 electron (or was it photon?) as "the smallest quantum that it makes sense to digitize"?

Jack

Hello Jack,

I'm having some difficulty in following your comments re: electrons.

The photon is a particle of light energy. It is not possible to have fractional particles, only integer quantities thereof. At the energy levels of visible light wavelengths, it is generally accepted that there is only enough energy per photon to move one electron from one energy level to another. The change in the energy level of that one electron causes a charge to go into a capacitance and that charge raises the voltage across the capacitance a smidgeon (7.14 microvolts in my camera). Thus the output voltage from the sensor changes by discrete steps as far as electron 'counting' is concerned. Physicists will dislike the foregoing over-simplified explanation.

If the foregoing is acceptable then we can see that the unity 'gain' condition occurs when, during an exposure, the ISO is such that a perfect pixel accumulates exactly 4095 electrons (12-bit ADC assumed) all of which produce a voltage output which in turn, by definition, causes the ADC output to be binary 111111111111. I think that the point Clark is making goes something like this:

An ISO setting higher than the so-called unity gain value would be needed if there were a count of less than 4095 electrons. For example, 2048 would cause me to use an 'extended' setting if my camera had one, doubling the amplifier gain from whatever it was such that a change of one electron now causes a change of 2 ADU's or whatever we call them here. Our 12-bit ADC has just become effectively an 11-bit ADC. Which effectively halves both the dynamic range and the signal resolution, eh?

The 'Unity Gain' concept is quite artificial and therefore, with due respect, I think that the introduction of noise as a consideration is both confusing and unnecessary.

Hope this helps,
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 10:57:35 am
Hi Ted,

Ok, good point about energy levels: so you say one photon = one electron?  Does it make a difference as to what the energy of the photon in question is (i.e. 380nm, vs 760nm light) as far as the number of electrons generated?

The 'Unity Gain' concept is quite artificial and therefore, with due respect, I think that the introduction of noise as a consideration is both confusing and unnecessary.

I am all for keeping things simple, however noise is a pretty key element of this discussion as I hope to show below.  I am thinking about the noise that is always inherently present in light, sometimes referred to as shot noise, because its distribution is similar to the arrival statistics of shot from a shot gun, whch was characterized by a gentlemen by the name of Poisson.

So now we can address the integer nature of electrons.  Let's assume that each photosite is a perfect electron counter with Unity Gain. 10 electrons generated by the photosite, the ADC stores a count of 10 in the Raw data with no errors.  Example 1: the sensor is exposed at a known luminous exposure and the output of the photosite in question is found to result in a Raw value of 2.  What is the signal?

We cannot tell by looking at just one photosite.  The signal could easily be 1,2,3,4,5, 6... For instance if it were 4, shot noise would be 2, and a value of 2 is only a standard deviation away. To know what the signal is, we need to take a uniform sample of neighbouring photosites, say a 4x4 matrix*.  We gather statistics from the Raw values from each photosite and compute a mean (the signal) and a standard deviation (the noise).  In this example it turns out that the signal was 1 electron with standard deviation/noise of 1.  Interestingly, the human visual system works more or less the same way.

Example 2: a new exposure resulting in a signal of 7 electrons for each photosite in the 4x4 matrix on our sensor.  Of course each does not get exactly 7 electrons because photons arrive randomly, and in fact we know thanks to M. Poisson that the mean of the values in our 4x4 matrix should indeed be 7 but with a standard deviation of 2.646 - so some photosites will generate a value of 7 but many will also generate ...2,3,4,5,6,8,9,10,11,12....   The signal is the mean of these values.

Example 3: Different exposure. Say we look at our 4x4 matrix of Raw values and end up with a mean of 12.30 and a standard deviation of 3.50.  Using the Effective Absolute QE for the D800e above (15.5)% and ignoring for the sake of simplicity Joofa's most excellent point above, could we say that this outcome resulted from exposing each photosite to a mean of +12.3/0.155= 79.35 photons?  After all, this number of photons is a mean itself.

What does this mean for Unity Gain?

Jack
*The area within the circle of confusion on an 8x12" image watched by a normal person with 20/20 vision at arm's length corresponds to the area of about 16 sensels on a typical modern FF DSLR.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 11:10:02 am
For fun, I applied the theory there to the full SNR curves that can be found at DxO (http://www.dxomark.com).

Jack, one thing you might do with your curves to make the departures from ideality (Is that a word? My spell-checker doesn't think so.) more obvious is subtract out the 3 DB/octave (or half a stop per stop, if you use log base two axes in both directions like I do) contribution of the photon noise. I wish DxO did this; it would make it easier to see what's going on in the camera, rather than reproducing the physics of photon noise over and over.

Here's an example of a similar, but not identical, set of curves, this one showing noise as a function of ISO with the ADC count held constant.

(http://www.kasson.com/ll/D800ESNRvsISO.PNG)

This shows small departures from ideal performance that would be invisible without subtracting out the effects of the photon noise.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 11:14:56 am
So one way to specify the signal in log 2 fashion familiar to photographers would be as a function of Stops from Clipping.  Another way I've seen it (as in RawDigger) is to assign O EV to 12.5% (as per the relative ISO Saturation Speed standard).  This way Saturation is +3 EV and everything else falls into place.

Thanks, Jack. Yeah, I've been sloppy. I like the "Stops from Clipping" description. I've got a workshop coming up at the end of April. I think I'll go with that nomenclature, and see how well people get it.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 11:21:22 am
Something seems wrong here: the M9 sensor should have roughly the same 60,000 electron full well capacity as other Kodak full frame type sensors with 6.8 micron pixels, like the KAF-31600: http://www.truesenseimaging.com/all/download/file?fid=11.62
so that 30,000 seems too low...

You may be right. The M9 behavior is quite different from the model, even though the other cameras are falling into line better and better as I make the simulation more sophisticated. Maybe there's something about he camera that needs special modeling, or maybe my data is in error (I'll go back and spot-check it).  

Check my algebra on my simple-minded full well approximation:

If the number of bits in the ADC is Badc, the base ISO is ISObase, and the Unity Gain ISO is ISOug

Full Well Capacity = (2^Badc)*(ISOug/ISObase)


Thanks,

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 01:09:16 pm
Jack, one thing you might do with your curves to make the departures from ideality (Is that a word? My spell-checker doesn't think so.) more obvious is subtract out the 3 DB/octave (or half a stop per stop, if you use log base two axies in both directions like I do) contribution of the photon noise. I wish DxO did this; it would make it easier to see what's going on in the camera, rather than reproducing the physics of photon noise over and over.

Good Idea.

Here's an example of a similar, but not identical, set of curves, this one showing noise as a function of ISO with the ADC count held constant.

(http://www.kasson.com/ll/D800ESNRvsISO.PNG)

This shows small departures from ideal performance that would be invisible without subtracting out the effects of the photon noise.

This shows nicely the effect of read noise at a constant raw value (of 1000, I assume) as the ISO is increased.  Is this the objective of the graph?  If not, and you just want to show deviation from 'normal', you may want to remove the effect due to read noise as well...  However, if you are using DxO's curves as the source of data you may have difficulty showing deviation from 'normal' because I understand that they do some curve fittin'  ;)

PS Jim, did I understand correctly from a previous post of yours that you are the inventor of Subtractive Dithering?  That is one bloody brilliant idea!
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 01:23:56 pm
This shows nicely the effect of read noise at a constant raw value (of 1000, I assume) as the ISO is increased.  Is this the objective of the graph? 

The purpose of the graph was to find the point where the read noise on the input side of the amplifier stops being constant as the ISO setting is increased. This graph tells me that above ISO 1600, not only does increasing the ISO setting not make things better, it actually starts to make things worse.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 01:25:13 pm
However, if you are using DxO's curves as the source of data you may have difficulty showing deviation from 'normal' because I understand that they do some curve fittin' 

I'm making my own test images in all cases.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 01:43:28 pm
Jim, did I understand correctly from a previous post of yours that you are the inventor of Subtractive Dithering?  That is one bloody brilliant idea!

Jack,

Yes, in a way, although we didn't call it that. The idea was to inject a signal centered at half the Nyquist frequency before digitization and filter it out (that's the subtractive part) after reconstruction. One of the parts I liked was that it didn't matter if part of the signal was aliased, since it was going to get filtered out anyway, so we got double the effect for the same noise than what we would have gotten if the dither signal was all below the Nyquist frequency.

http://www.google.com/patents/US3999129 (http://www.google.com/patents/US3999129)

Modern subtractive dither is more sophisticated.

Jim

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 26, 2013, 03:30:29 pm
Hello again Jack,

We may have a misunderstanding. I am only talking about the definition of Unity Gain, per the topic. Since the definition itself excludes photons, they and their distributions, Poisson, etc., are not relevant to the definition. The definition starts at the sensor output and knows nothing of the shot noise and thermal noise generated therein. Thus I am able to answer as below:

Hi Ted,

Ok, good point about energy levels: so you say one photon = one electron?  Does it make a difference as to what the energy of the photon in question is (i.e. 380nm, vs 760nm light) as far as the number of electrons generated?
To be pedantic, one photon = one or no electron. 380nm vs. 760nm makes no difference, other than 380nm has more energy and is more likely to whack an electron. However, there are devices that can produce more electrons than photons, such as photo-multipliers and those night-vision thingies (not IR) much beloved by the military.

Quote
I am all for keeping things simple, however noise is a pretty key element of this discussion as I hope to show below.  I am thinking about the noise that is always inherently present in light, sometimes referred to as shot noise, because its distribution is similar to the arrival statistics of shot from a shot gun, whch was characterized by a gentlemen by the name of Poisson.

Yes, shot noise and sensor thermal noise exist, of course, but they are earlier in the signal chain than the sensor output and are not, therefore, part of the definition.

Quote
So now we can address the integer nature of electrons.  Let's assume that each photosite is a perfect electron counter with Unity Gain. 10 electrons generated by the photosite, the ADC stores a count of 10 in the Raw data with no errors.  Example 1: the sensor is exposed at a known luminous exposure and the output of the photosite in question is found to result in a Raw value of 2.  What is the signal?

By including signal processing downstream of the ADC you are going outside the bounds of the definition. By including illuminance at the sensor face, you are again going outside the bounds of the definition. Therefore, the question is not relevant to "unity gain" and - with respect - by not defining "the signal", you are also rendering the question moot.

Quote
We cannot tell by looking at just one photosite.  The signal could easily be 1,2,3,4,5, 6... For instance if it were 4, shot noise would be 2, and a value of 2 is only a standard deviation away. To know what the signal is, we need to take a uniform sample of neighbouring photosites, say a 4x4 matrix*.  We gather statistics from the Raw values from each photosite and compute a mean (the signal) and a standard deviation (the noise).  In this example it turns out that the signal was 1 electron with standard deviation/noise of 1.  Interestingly, the human visual system works more or less the same way.

Quite so, but I'm sure that the definition is meant to be about the camera ISO setting and not the captured scene. That is to say that the gain of the amplification from the sensor output to the ADC output, i.e. the ISO setting itself, knows nothing of the scene nor anything of subsequent processing. And you will remember that the sensels are sampled one at a time and know nothing of their neighbors values. Equally, the ADC input only receives sensel values one at a time and I believe that to be a very important point for you to consider. Remember again that the definition does not include or imply any signal processing after the ADC output. Therefore "the signal", as far the definition is concerned, is the output of one sensel and one sensel only, not a number thereof.

Quote
Example 2: a new exposure resulting in a signal of 7 electrons for each photosite in the 4x4 matrix on our sensor.  Of course each does not get exactly 7 electrons because photons arrive randomly, and in fact we know thanks to M. Poisson that the mean of the values in our 4x4 matrix should indeed be 7 but with a standard deviation of 2.646 - so some photosites will generate a value of 7 but many will also generate ...2,3,4,5,6,8,9,10,11,12....   The signal is the mean of these values.

No, "the signal" can not be anything but the discrete value of one sensel output. No algebra, statistical or otherwise, is done until after the ADC output and therefore is not part of the definition.

Quote
Example 3: Different exposure. Say we look at our 4x4 matrix of Raw values and end up with a mean of 12.30 and a standard deviation of 3.50.

We can't look at different 16 sensel values and do any calculations on them - the definition only includes a gain term, taken one sensel at a time. Of course, the camera can do what it likes with as many sensel values that it likes and the consequent RAW file can show distributions of all kinds, BUT, being outside of the signal path from the sensor output to the ADC output, that has nothing to do with the definition.

Quote
Using the Effective Absolute QE for the D800e above (15.5)% and ignoring for the sake of simplicity Joofa's most excellent point above, could we say that this outcome resulted from exposing each photosite to a mean of +12.3/0.155= 79.35 photons?  After all, this number of photons is a mean itself.

No we could not. We can calculate a mean and SD for discrete items such as the number of electrons in a number of photosite and we can indeed assign fraction values to the said mean and SD. But, sorry, we can not turn the equation around and come up something like 79.35 photons. All that figure tells you is that it is perhaps more likely that there were 79 photons than 80 photons. You can not have a fractional number of photons. Physically impossible.

I find it disturbing that fractional photons are still being mentioned. There can be no such thing. If this basic fact about the nature of light is not understood, then nothing else can be accepted or understood and, with all due respect, our discussion would be at an end.

So, time for a question of my own:

Is it the opinion of your goodself, or indeed of this forum, that fractional photons can exist?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 05:09:25 pm
Yes, shot noise and sensor thermal noise exist, of course, but they are earlier in the signal chain than the sensor output and are not, therefore, part of the definition.

I hear you, but that's a pretty narrow definition, as is the definition of signal as the output of a single photosite, or charge collection efficiency as wavelength independent (http://en.wikipedia.org/wiki/Responsivity) - that's not the way that things work in the real world and that definition doesn't help to answer the common place that I am trying to get to the bottom of: is "one electron the smallest quantum that makes sense to digitize" as Mr. Clark says?  Or is there more of an articulated answer once Information Science is brought to bear? I have no answers, I am just curious.

To help us converse let me define the signal as the mean Raw value from a 4x4 sensel matrix on our sensor illuminated uniformly by an exposure in lx-s that would not break down into an integer number of photons.  The sort of mean signal that you would read off of a 4x4 sampling area in RawDigger  (http://www.rawdigger.com)and trace back to electrons and photons.

I am open to suggestions but my gut says that it is more complex than Mr Clark suggests, because light, electrons and the human visual system are stochastic systems, based on statistics.  Noise is an integral part of them at every level.  In the light itself, in the sensor, in the ADC in our visual and processing system.  If it's not there it gets injected (Jim inserted noise in the ADC so that he would have dithering and then figured out how to take it back out later - brilliant stuff, check the text around the bottom figure of this page (http://www.dspguide.com/ch3/1.htm)).

As to your question, nobody is challenging the fact that light comes in quanta.  Physics has spoken about that a century ago and we all agree on it.  I may be completely off base but what I am trying to understand is whether Unity is just a figment of our imagination because integers are warm and fuzzy and allow us to calculate certain things easily, or whether it is grounded in something deeper. 

With appropriately sized noise dithering we are able to record integer values that allow us to represent electrons and fractions thereof in a stochastic  process.  What does unity mean in this context?  If instead of 1:1 it is 0.5:1, what's the real difference when the signal is a noise dithered 7.2 ADU/electrons/photons?  Isn't this the same as going from ISO 400 to 200 with an ISOless sensor while keeping exposure the same?  Half the Raw values but same information captured?

Perhaps Jim could give us a hand?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 26, 2013, 05:39:31 pm
...what I am trying to understand is whether Unity is just a figment of our imagination because integers are warm and fuzzy and allow us to calculate certain things easily, or whether it is grounded in something deeper...

Jack, let me take a crack at this. I think that the Unity Gain ISO concept, in spite of its unfortunate name, gets at something useful. I think the key to the distinction that you're making is where does the averaging inherent in computing the mean value occur? I know these systems aren't perfect, but let's start with an ideal model: a photosite that, after getting hit by some photons, contains an integer number of electrons, since that's the way electrons come. Let us further imagine that the charge produced by that group of electrons in close proximity can be amplified by a noiseless amplifier. The output of the amplifier with then be quantized, with each electron in the photosite adding to the voltage. Say the output of the amplifier at some gain is such that each electron in the photosite contributes one microvolt to the output of the amplifier. At the output of the amp, we might see 10 microvolts, we might see 12 microvolts, but we won't see 13.5 microvolts. Let's say that the ADC is set up so that a 2 microvolt change in the input produces a 1 LSB change in its output. With the amplifier set up with the gain as above, 10 electrons and 11 electrons will produce the same ADC output. If we double the gain, 10 electrons and 11 electrons will produce outputs that are different by 1 LSB. But if we double the gain again, we'll still only see the same number of possible output states of the ADC, with the code for 11.5 electrons unused, since the ADC never sees the voltage represented by fractional electrons.

Averaging takes place in two ways, across photosites and across exposures. But when we talk about a mean value of 13.654 electrons, we're talking about the average of a bunch of integers.

Adding noise messes things up. You could say that electrical noise smaller than one electron's worth of voltage referred to the input of the amplifier creates a dither signal that allows resolution of non-integer mean electron counts as long as the noise is at least comparable to 1 LSB, and you'd be right. So I take this Unity Gain thing with a grain of salt. I figure when the ISO knob on the camera gets a stop or two past what is necessary to get Unity Gain, then I should stop twisting it unless I have a good reason.

Also, dithering is not without cost, if we can't remove it later, and it's not clear that we can in this case. The noise removal tools in Lightroom and fancy plugins seem magical sometimes, but they do trade off resolution for noise reduction.

When we get to cameras that oversample the highest frequencies the lens can produce and we're using many camera pixels for every pixel we send the printer, then maybe Unity Gain ISO will have outlived its usefulness.

Does that help?

Jim

PS. Maybe in a further post I'll get into why the shoulder of the DlogE film curve was A Good Thing, and why ETTR images don't have one, and how Lightroom kinda gives it back sometimes. I've got to do some more testing first.

PPS. I don't actually know how the cameras manage to achieve the level of precision that they do; at hp we used to joke that voltage was quantized at the microvolt level, since we had such a hard time making reliable measurements below that.





Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 26, 2013, 06:01:05 pm
Adding noise messes things up. You could say that electrical noise smaller than one electron's worth of voltage referred to the input of the amplifier creates a dither signal that allows resolution of non-integer mean electron counts as long as the noise is at least comparable to 1 LSB, and you'd be right. So I take this Unity Gain thing with a grain of salt. I figure when the ISO knob on the camera gets a stop or two past what is necessary to get Unity Gain, then I should stop twisting it unless I have a good reason.

Yes, I believe that most modern DSCs with the latest crop of advanced sensors have input referred read noise of around 1 LSB, which works very well for this purpose.

Also, dithering is not without cost, if we can't remove it later, and it's not clear that we can in this case. The noise removal tools in Lightroom and fancy plugins seem magical sometimes, but they do trade off resolution for noise reduction.

When we get to cameras that oversample the highest frequencies the lens can produce and we're using many camera pixels for every pixel we send the printer, then maybe Unity Gain ISO will have outlived its usefulness.

Does that help?

Yes it does, thank you.  My Information Science base is weak, so it takes me a while to reconcile deterministic and statistical versions of the same laws.  The more I think about it the less I see Unity Gain as a parameter in the calculation of the amount of information captured in this particular channel.  Which of course does not mean that it doesn't have its uses.

Thanks again for your help,
Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 26, 2013, 06:45:18 pm
I hear you, but that's a pretty narrow definition, as is the definition of signal as the output of a single photosite, or charge collection efficiency as wavelength independent (http://en.wikipedia.org/wiki/Responsivity) - that's not the way that things work in the real world and that definition doesn't help to answer the common place that I am trying to get to the bottom of: is "one electron the smallest quantum that makes sense to digitize" as Mr. Clark says?  Or is there more of an articulated answer once Information Science is brought to bear? I have no answers, I am just curious.

To help us converse let me define the signal as the mean Raw value from a 4x4 sensel matrix on our sensor illuminated uniformly by an exposure in lx-s that would not break down into an integer number of photons.  The sort of mean signal that you would read off of a 4x4 sampling area in RawDigger  (http://www.rawdigger.com)and trace back to electrons and photons.

I am open to suggestions but my gut says that it is more complex than Mr Clark suggests, because light, electrons and the human visual system are stochastic systems, based on statistics.  Noise is an integral part of them at every level.  In the light itself, in the sensor, in the ADC in our visual and processing system.  If it's not there it gets injected (Jim inserted noise in the ADC so that he would have dithering and then figured out how to take it back out later - brilliant stuff, check the text around the bottom figure of this page (http://www.dspguide.com/ch3/1.htm)).

As to your question, nobody is challenging the fact that light comes in quanta.  Physics has spoken about that a century ago and we all agree on it.  I may be completely off base but what I am trying to understand is whether Unity is just a figment of our imagination because integers are warm and fuzzy and allow us to calculate certain things easily, or whether it is grounded in something deeper.  

With appropriately sized noise dithering we are able to record integer values that allow us to represent electrons and fractions thereof in a stochastic  process.  What does unity mean in this context?  If instead of 1:1 it is 0.5:1, what's the real difference when the signal is a noise dithered 7.2 ADU/electrons/photons?  Isn't this the same as going from ISO 400 to 200 with an ISOless sensor while keeping exposure the same?  Half the Raw values but same information captured?

Perhaps Jim could give us a hand?

I was going to respond point by point but, as we both know, that can lead to very long and boring posts.

I agree that the condition for Unity Gain being the gain (ISO) where 1 electron moves the ADC output by 1 ADU is indeed a "narrow definition" but that is the only definition that I can find in the literature, so that is the definition I am using. If anyone knows of a different definition I'm sure we would be interested to hear it.

Since this thread appears to be less about Unity Gain per se and more about noise, dithering and other such complications, I'm inclined to bow out - as I have nothing to offer on those subjects.

Before I go, it was said that:

Quote
. . . I am trying to get to the bottom of: is "one electron the smallest quantum that makes sense to digitize" as Mr. Clark says?

I did offer a response earlier to that question re: reducing the DR and resolution but, with so much verbiage in our posts, perhaps it was missed?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 26, 2013, 07:49:24 pm
No we could not. We can calculate a mean and SD for discrete items such as the number of electrons in a number of photosite and we can indeed assign fraction values to the said mean and SD. But, sorry, we can not turn the equation around and come up something like 79.35 photons. All that figure tells you is that it is perhaps more likely that there were 79 photons than 80 photons. You can not have a fractional number of photons. Physically impossible.

I find it disturbing that fractional photons are still being mentioned. There can be no such thing. If this basic fact about the nature of light is not understood, then nothing else can be accepted or understood and, with all due respect, our discussion would be at an end.

So, time for a question of my own:

Is it the opinion of your goodself, or indeed of this forum, that fractional photons can exist?

Hi Ted,

There is no such a thing, so I couldn't agree more with your analysis on unity gain. Unity gain also has little to do with things like quantum efficiency. The only thing that counts is the number of electrons that are freed and collected. It's not without reason that astronomers and those active in that field (like Roger Clark) seem to accept the notion of unity gain, because there are usually so few of them (photons that is) in astronomy. Also, transmitting irrelevantly accurate data across space is costly.

Given the fact that only those photons that get through the sensor cover-glass, and Bayer CFA, and past the surface structures/apertures and gates, and transitors (on CMOS devices), and penetrate to the correct depth to be counted, get counted. Those are the only ones to be considered in any image forming statistics.

The concept of Unity Gain is linked to the ADC (offset and gain) and the quantization bit-depth, but I also agree that the input of the ADC, and it's output, are related but different things. It's mainly after the ADC (unless there was a pre-amp) that all sorts of noise is added to the collected charge. The arrival rate of photons during the exposure time is a statistical process described by Poisson distribution statistics, but has no further influence once the electron(s) is(are) recorded.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 26, 2013, 08:11:19 pm
I hear you, but that's a pretty narrow definition, as is the definition of signal as the output of a single photosite, or charge collection efficiency as wavelength independent (http://en.wikipedia.org/wiki/Responsivity) - that's not the way that things work in the real world and that definition doesn't help to answer the common place that I am trying to get to the bottom of: is "one electron the smallest quantum that makes sense to digitize" as Mr. Clark says?  Or is there more of an articulated answer once Information Science is brought to bear? I have no answers, I am just curious.

Hi Jack,

Each single (one) electron is the only thing that matters once collected (on a per sensel collection area). It helps to quantize it before we can do something useful with it. When the gain is such that 1 or 2 (or more) electrons will produce the same ADU, it will not be unity gain. When each single captured electron produces a different ADU, unity gain is in effect, and the bit depth of the ADC is optimally utilized. The fact that there may be more electrons from other processes (electronic noise, dark current, and what have you) doesn't change the importance of being able to quantize each and every EXPOSURE related electron with enough accuracy. The electronic noise and such can be mostly eliminated by taking multiple samples and averaging them, which leaves the exposure signal itself (and its Poisson noise distribution), which is what interests photographers most.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 27, 2013, 05:12:58 am
Hi Jack,

Each single (one) electron is the only thing that matters once collected (on a per sensel collection area). It helps to quantize it before we can do something useful with it. When the gain is such that 1 or 2 (or more) electrons will produce the same ADU, it will not be unity gain. When each single captured electron produces a different ADU, unity gain is in effect, and the bit depth of the ADC is optimally utilized. The fact that there may be more electrons from other processes (electronic noise, dark current, and what have you) doesn't change the importance of being able to quantize each and every EXPOSURE related electron with enough accuracy. The electronic noise and such can be mostly eliminated by taking multiple samples and averaging them, which leaves the exposure signal itself (and its Poisson noise distribution), which is what interests photographers most.

Cheers,
Bart

Bart, Ted and Jim, very helpful, thank you for indulging me with a less than intuitive subject - I am sure Mr. Clark is a very smart man and I may be completely off base here but I've been thinking about this for a while, meandering a bit without being able to phrase the question properly.  In a nutshell, are we not making the same mistake as those who think that engineering DR is equal to bit depth, relating a bit to a doubling of signal instead of to a basic unit of information?  As I said, my information science is weak  :)

I understand the importance of being able to record the information of each and every EXPOSURE related electron with enough accuracy.  My question, which you are helping me to clarify even with myself, is whether that means recording electrons to ADUs one for one.  I agree, as Ted mentioned and Jim related in his example, that in the complete absence of noise the answer would be yes.  But what about in a typical real world situation with shot noise present in the signal and around 1 ADU of input-related read noise at the ADC (http://home.comcast.net/~NikonD70/Charts/RN_ADU.htm#D600_14,D800E_14)?

The example that brought me to this type of thinking is this:  I am in the field with a D7000, I maxed out exposure according to my blur and dof constraints and set ISO to 400 in order to just retain detail in the brightest desired highlight, the top of which now sits just above DN 16000 in the Raw file of a test image I looked at with RawDigger, making the most of my available bits.  Then I remember that the D7000 is ISOless between ISO 400 and 100 so I cut back gain (errr, ISO) to 100 while keeping exposure unchanged to obtain a welcome two additional stops of wiggle room in the [EDIThighlights] Raw data - which can now be better compressed.  Now the brightest desired highlight sits just above DN 4000 in the Raw data and all tones underneath it have been compressed by a factor of four.  Am I degrading IQ perceptiibly?  BTW, Unity Gain for the D7000 as calculated by MR. Clark should be at about ISO 240, if I understand it correctly, because at ISO 100 about 2.38 electrons are needed for 1 ADU.

The intuitive answer is, yes you are degrading IQ - because now you have compressed your original target signal range, using only a quarter of the bits as before to record it, so you are losing resolution in the graduations.  But the real world answer is no, we are not degrading IQ perceptibly because dithering occurs as a result of noise unavoidably present in the system (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p3.html#bitdepth).  We are able to record virtually the same information as in the first case plus some more.  This second way simply makes more efficient use of the 14-bit channel width*.

So what gives?  Is unity gain necessary in order to maximize information captured aotbe?  Apparently not in this case.  In the presence of appropriately sized noise, should the desired tonal range fit within the Raw value range, would a gain of 0.5 or 0.25 e-/ADU not allow us to capture the desired information?  Isn't the decision of when to stop raising gain not related just to the size of the smallest quantum but also the relative size of the noise?  Can we be a bit more precise than when Jim suggested 'I figure when the ISO knob on the camera gets a stop or two past what is necessary to get Unity Gain, then I should stop twisting it unless I have a good reason.'?  And what does "one electron [is] the smallest quantum that makes sense to digitize" mean in this context?

Jack
*  You can tell what next question this portends, right ;-)?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 27, 2013, 11:29:52 am
*  You can tell what next question this portends, right ;-)?

Jack, thanks for your pursuit of this issue. Answering your questions has not only helped me clarify my own thoughts on this subject, but has helped me prepare for the workshop that I'll be involved in next month. I will get to your larger question, but I need to perform a few experiments first, so let me deal with the implied question that you raised at the end, which -- I think -- is, "What's a good reason for twisting the ISO past the point where all you're doing is amplifying the noise?"

The first reason is to be able to see what's going on in the preview image when chimping. A lot of the time, that's optional. However, when you're using a mirrorless camera like the NEX-7 or the RX-1 (by the way, I am continually awed by the combination of size and IQ of the RX-1; I haven't had a camera that so affected the way I make pictures since the D3 came out; no art yet, though), sometimes you need to turn up the ISO to see enough to frame, focus, etc. the picture.

The second reason is to have enough range in your raw processor to boost the "Exposure" in post. Lightroom only offers 5 stops.

There may be more, but those are my top two.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 27, 2013, 11:35:38 am
Bart, Ted and Jim, very helpful, thank you for indulging me with a less than intuitive subject - I am sure Mr. Clark is a very smart man and I may be completely off base here but I've been thinking about this for a while, meandering a bit without being able to phrase the question properly.  In a nutshell, are we not making the same mistake as those who think that engineering DR is equal to bit depth, relating a bit to a doubling of signal instead of to a basic unit of information?  As I said, my information science is weak  :)

I can help with that. The word 'bit' originally was a contraction of 'Binary DigIT' meaning a signal that was either ON or OFF with no other states allowed. It is also used in what is called base-2 arithmetic instead of our more familiar base-10. In base-10 the last digit of a number can have 10 values 0 to 9, the next over 0 to 90 (in tens), etc. In binary, the last digit, also called the least significant bit, can have two values 0 or 1, the next over 0 or (not 'to') 2, the next over 0 or 4, etc. In this context, 'bit' means a binary digit place-holder and e.g. 12-bit means 12 placeholders: 0 or 1 thru 0 or 2047. Relating to your question: if I added a placeholder, there would be 13 and the most significant bit would mean 0 or 4095. "4095?!" you go, "surely that's 12 bit?" but remember, all the other bits (placeholders) can also be '1' so the 13-bit binary number represent more than 4095, namely 8191, given by 2^(no of placeholders) - 1. By the same token, the number of possible color values for red on your screen is 2^8 - 1 = 255. 256 if you count black.

Confusion occurs when 'bit' is also used, by itself, in a different context - that of meaning how many ADU's are represented by e.g. an 8-bit number (also known as a byte) for example 00001101 represents 13 bits, e.g. ADUs of information. Equally, going back to resolution, if we effectively remove one bit from a 12-bit ADC, it becomes an 11-bit ADC having only 2047 positive values, excluding 0, thus halving the resolution and the ADC DR.

A hyphen or, if no hyphen, 'bit' used in the singular should imply the number of placeholders, e.g. 14-bit ADC has 14 binary digit output lines (placeholders). 'Bits' should relate to a number of ADU's, e.g. a color of 128 bits (ADUs) on your 8-bit (8-placeholder) monitor is half-saturated.

The DR is halved in my earlier example because the minimum positive value out of the ADC becomes 2 (binary 000000000010) and that was because I doubled the ISO for Unity Gain. Do remember that one electron, irrespective of its source, causes a discrete increase in sensor output voltage. So increasing electron counts by one (at, say, 8uv/electron) you get 8, 16, 24, 32uv, et subs and the ADC outputs least 4 placeholders go 0010 (2 ADU), 0100 (4 ADU), 0110 (6 ADU), 1000 (8 ADU). In other words: if 1-e causes 1 ADU of output at the ISO for Unity Gain then, by going up one stop (doubling the ISO), 1-e causes 2 ADUs of output in 2-ADU steps. That halves the best possible ADC DR from 4095/1 (12 stops) to 4095/2 (11 stops). It also halves the best possible scene DR because the ADC input is now saturated by half the electrons ergo half the photons, all other things being equal.

ADC noise is not included in the above explanation, but is often quoted as +/- 1 LSB. VGA (variable gain amplifier) noise/offset is not included either but can be significant, see here (http://www.analog.com/static/imported-files/rarely_asked_questions/moreInfo_raq_opAmpNoise2.html), as well any VGA output voltage offset due to thermal effects.

From the way Roger Clark writes, I deduce that he is no physicist. But my foregoing paragraphs may illustrate his point about the effect of exceeding Unity Gain ISO. Although my example of going over by 1 stop was extreme (to make the explanation easy), it does illustrate that exceeding the Unity Gain ISO by any value will have some deleterious effect.

Hope that helps,
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 27, 2013, 12:09:45 pm
The intuitive answer is, yes you are degrading IQ - because now you have compressed your original target signal range, using only a quarter of the bits as before to record it, so you are losing resolution in the graduations.  But the real world answer is no, we are not degrading IQ perceptibly because dithering occurs as a result of noise unavoidably present in the system (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p3.html#bitdepth).

Jack, there's an assumption in the way you frame the issue: that, no matter how far up I crank the ISO, there's enough noise in the system to fill in the histogram so that all the possible ADC outputs in the middle of the histogram are used. I decided to test that assumption. With a D800E set at ISO 6400, I took an image of what is in danger of becoming my favorite subject, my LCD, at 1/30 second, defocused, average green channel around five stops below clipping (to use my new (thanks to you) formulation). I took a look at the histogram. Here it is at two levels of magnification:

(http://www.kasson.com/ll/D800E500x500Z3ISO6400detailHisto.PNG)

(http://www.kasson.com/ll/D800E500x500Z3ISO6400MostDetailHisto.PNG)


You can see that there are a lot of missing codes. In fact, there are typically three empty codes between each occupied one.

If the gears in your head are turning and you're thinking, "Yes, but with a unity gain ISO of around 300, at ISO 6400, the "gain" is about 20, and there should be more missing codes than that." Well, you're right, but consider the limitations of the experiment. With this test, I am probably using all the amplifiers and maybe all the ADCs, all of which have slightly different characteristics. If I could test one amp and one ADC, I'd probably get bigger gaps in the histogram.

There is a way that I could test one ADC and one amplifier: I could look at the same pixel in successive exposures. However, I don't have the patience to gather enough samples for that experiment. As my math teachers used to say, it is left as an exercise for the interested student.


We are able to record virtually the same information as in the first case plus some more.

I would phrase it, "We are able to record virtually the same information, plus some more noise, and not as much of either at it looks like we are recording from looking at the broad-brush histogram (because of the missing codes we can't see when we're looking at the whole histogram)."

Jim

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 27, 2013, 01:02:14 pm

[Addition: if I knew the internal organization of the amps and ADCs in the D800E, I could craft a selection that only encompassed one of each. Anyone know enough to tell me how to do that?]


Unfortunately, Jim, it's likely to be a chip called an analog front end (AFE) beloved by current camera mfgs: a) cheaper b) smaller c) cheaper d) cheaper. Thus analysis will be difficult because it's a 'black box' thingy with all those amps ADCs and more inside. Here's one (PGA = programmable gain amplifier) good for a Foveon sensor (3-channel):

http://www.analog.com/static/imported-files/data_sheets/AD9814.pdf

[edit] the link shows a 14-bit ADC driving an 8-bit chip output which was puzzling but I think it delivers a 16-bit output in two shots: the 8 LSBs and then the 8 MSBs but with the 4 most significant of those set to 0.[/edit]

Love the LCD idea . . must play.

Not sure about "We are able to record virtually the same information, plus some more noise, and not as much of either [as] it looks like we are recording from looking at the broad-brush histogram (because of the missing codes we can't see when we're looking at the whole histogram" but it does read well  ;)

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 27, 2013, 01:22:49 pm
I can help with that.Hope that helps,

It does, thank you Ted, I appreciate the excursus.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 27, 2013, 01:25:13 pm
Thus analysis will be difficult because it's a 'black box' thingy with all those amps ADCs and more inside.

I figured that I'd start with rows and columns. Here's a selection 2 pixels high and 200 wide (if it's not at least two in the small dimension, you only get half the channels).

(http://www.kasson.com/ll/D800E2x200Z3ISO6400MostDetailHisto.PNG)

And here's one 200 high and 2 wide:

(http://www.kasson.com/ll/D800E200x2Z3ISO6400MostDetailHisto.PNG)

I don't know if I've gotten to a single amp and ADC in either case, but if I have, the following is a reasonable interpretation. There are peaks separated by about 20 counts, as you would expect from an ISO about 20 times the unity gain ISO. There appears to be noise after the amp and before the ADC with a standard deviation of about 6 LSBs. However, it also looks like the ADC is functioning effectively as a 12-bit device. What's up with that?

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 27, 2013, 01:37:56 pm

I don't know if I've gotten to a single amp and ADC in either case, but if I have, the following is a reasonable interpretation. There are peaks separated by about 20 counts, as you would expect from an ISO about 20 times the unity gain ISO. There appears to be noise after the amp and before the ADC with a standard deviation of about 6 LSBs. However, it also looks like the ADC is functioning effectively as a 12-bit device. What's up with that?
To paraphrase Slick Willy "it all depends what the meaning of 'up' is . ."

Earlier, out of interest, I calculated the D800 Unity Gain ISO using Clark's method. For a 12-bit in-camera setting it comes to 666 (!). For a 14-bit it comes to 108 which is quite interesting. So, back to 666, 20 times brings us to 13,300 ISO, not 6,400. I'm probably obfuscating the difference between theory and practice, so feel free to ignore this post.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 27, 2013, 02:01:53 pm
You can see that there are a lot of missing codes. In fact, there are typically three empty codes between each occupied one.

If the gears in your head are turning and you're thinking, "Yes, but with a unity gain ISO of around 300, at ISO 6400, the "gain" is about 20, and there should be more missing codes than that." Well, you're right, but consider the limitations of the experiment. With this test, I am probably using all the amplifiers and maybe all the ADCs, all of which have slightly different characteristics. If I could test one amp and one ADC, I'd probably get bigger gaps in the histogram.

Your examples are excellent, Jim, and stimulate further thinking.  Interesting that the values have roughly the same sized gaps (i.e. 1 value about every 4 ADUs) and those that are present are the same for the three channels (i.e. 434, 438, 442 etc.).  This could suggest that the histogram was fully populated at the output of the ADC, but that there was a digital multiplication by a factor of around four (the other gaps could be explained if it wasn't exactly 4x) after that before the data was written to the raw file.  In other words gain is increased on the actual ADC (analogically?) up to somewhere around ISO 1500 (6400 divided by 4+).  The fact that the amps and ADCs are not all exacly the same contributes to the (nevertheless outstanding) read noise of the D800e, helping to fully populate the histogram up to that point.  After that it is a simple digital multiplication by 4+, creating the gaps.

We are able to record virtually the same information as in the first case plus some more.

I would phrase it, "We are able to record virtually the same information, plus some more noise, and not as much of either at it looks like we are recording from looking at the broad-brush histogram (because of the missing codes we can't see when we're looking at the whole histogram)."

Jim

I assume that you are referring to the case where, for a set exposure and having the highlight headroom in the raw data, one would increase ISO from 100 to 400.  Yes, I agree.  Except that I suspect that we would be able to record the same information, in part because of read noise dithering and in part because of shot noise dithering - the gaps would need to be much bigger than that to start affecting perceived information at these Raw values.  It would be interesting to see the histogram in the first hundred ADUs or so.

Jack
PS I am sure that you've seen this post about NEF information compression (http://www.openphotographyforums.com/forums/showthread.php?t=5499)
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 27, 2013, 02:11:25 pm
I don't know if I've gotten to a single amp and ADC in either case, but if I have, the following is a reasonable interpretation. There are peaks separated by about 20 counts, as you would expect from an ISO about 20 times the unity gain ISO. There appears to be noise after the amp and before the ADC with a standard deviation of about 6 LSBs. However, it also looks like the ADC is functioning effectively as a 12-bit device. What's up with that?
Still exactly the same values show (and don't show) up with the same interval. Looks like about 4x digital amplification after the ADC, which would make it function look like a 12 bit one [EDIT: the other 2 bits represent data beyond full scale].

On the other hand good show on attempting to isolate the amp/ADC.  You've probably got more than one there.  This is quite an eye-opener and I need to digest all this great info a bit.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Vladimirovich on March 27, 2013, 02:16:17 pm

The second reason is to have enough range in your raw processor to boost the "Exposure" in post. Lightroom only offers 5 stops.


easy to fix - just create a simple mod of your camera profile w/ baseline exposure tag = X and voila, ACR/LR will have X+5 stops... for cases when you need more than 5 stops.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 27, 2013, 02:25:08 pm
Earlier, out of interest, I calculated the D800 Unity Gain ISO using Clark's method. For a 12-bit in-camera setting it comes to 666 (!). For a 14-bit it comes to 108 which is quite interesting. So, back to 666, 20 times brings us to 13,300 ISO, not 6,400. I'm probably obfuscating the difference between theory and practice, so feel free to ignore this post.

Ted, I get what Jim suggested, about 320 ISO at 14 bits.  I get that by taking FWC of roughly 52600 dividing by the number of ADUs at full scale (16382 for the 'e') and multiplying by 100.  The method you outlined does exactly the same but with a few redundant operations: reread your post, the answer is always n*100  :)
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 27, 2013, 02:51:10 pm
With the D4 under the same conditions, all bits are used. First, a 200 x 2 column view:

(http://www.kasson.com/ll/D4299x2.PNG)

Next, a 2 x 200 row view:

(http://www.kasson.com/ll/D42x200.PNG)

From the greater fill in the column, I'm guessing that the ADCs read by column. With a Unity Gain ISO of about 700, an electron charge should make a 10 LSB difference. The data can be interpreted that way if you're looking for it. The standard deviation of the noise appears to be on the order of 2 LSBs. The counts are low enough that all this interpretation is suspect, however.

Making the column 1000 pixels high shows no periodicity in the histogram.  I think that a definitive answer will need some more sophisticated analysis than histograms. Does anyone know a good way to turn raw files into 4 monochromatic TIFFs, preferably in batches? I'm not excited about using DCRAW. ImagesPlus?

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 27, 2013, 03:16:20 pm
PS I am sure that you've seen this post about NEF information compression (http://www.openphotographyforums.com/forums/showthread.php?t=5499)

Jack, even if I screwed up and turned lossy compression on, it shouldn't cause this effect, since the signal level is about 5 stops below full scale.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 27, 2013, 04:55:51 pm
Ted, I get what Jim suggested, about 320 ISO at 14 bits.  I get that by taking FWC of roughly 52600 dividing by the number of ADUs at full scale (16382 for the 'e') and multiplying by 100.  The method you outlined does exactly the same but with a few redundant operations: reread your post, the answer is always n*100  :)
Thanks, I didn't know the FWC so I used a value from a similar camera which I shouldn't have, tsk.

And, lo, I get 321 ISO for a 14-bit A->D conversion. Thanks.

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 27, 2013, 05:05:19 pm
I think that a definitive answer will need some more sophisticated analysis than histograms. Does anyone know a good way to turn raw files into 4 monochromatic TIFFs, preferably in batches? I'm not excited about using DCRAW. ImagesPlus?
ImageJ does lots of things that I've never used and don't understand.
IrfanView can mess with colors but I'm [edit] not sure about at RGGB level.
I don't have any non-Foveon raw files, well apart from old compressed D50 NEFs.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 27, 2013, 06:43:48 pm
Jack, even if I screwed up and turned lossy compression on, it shouldn't cause this effect, since the signal level is about 5 stops below full scale.
Of course.  I meant that you only need 600 or so codes to represent fully information from a 12-bit ADC with 4095 at full scale.  Lots of free levels there and nobody's noticing.  Apparently Nikon also does WB preconditioning, that's why you get gaps in the Raw data even in the green channel at ISO 100.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 27, 2013, 06:44:55 pm
Still exactly the same values show (and don't show) up with the same interval. Looks like about 4x digital amplification after the ADC, which would make it function like a 12 bit one.

I got interested in the missing codes, and evaluated some exposures made with five different cameras under the same conditions. The subject was the back of a lens cap. The exposure was 1/4 sec. The aperture was all the way stopped down, just to make sure. The ISO was 6400. The exposures were the first after the camera had "rested" a bit, although I'd seen not much in the way of thermal effects previously. I selected a central area 200x200 pixels, and ran a histogram of the region between a count of 4 and one of 100.

I used dark noise as a way to make sure that the always-on-no-matter-what-you-do tone curve compresion of the Sony cameras wouldn't come into play.

First, let's look at the two cameras that behaved as expected. The first of those is the Nikon D4.

(http://www.kasson.com/ll/d4200x200histodarknoise.PNG)

A few missing codes in the red and blue channels, which could well be due to ADC defects, or also digital gain applied to the red and blue channels. I'm thinking it's digital gain, because the noise appears to be higher in the red and blue, and I can't think of a reason why that would happen.

The next unsurprising results are from the Leica M9:

(http://www.kasson.com/ll/m9200x200histodarknoise.PNG)

Noisier than the D4, to be sure, but that's no surprise, and no missing codes at all.

The Sony RX-1 shows an interesting result:

(http://www.kasson.com/ll/rx-1200x200histodarknoise.PNG)

There are missing codes galore. The two green channels look quite different from each other. The upper green channel and the blue channel seem to be acting as if they'd been digitized by a 12-bit ADC, while the lower green channel and the red channel are doing a fairly good imitation of 13-bit digitized signals. The loss of the LSB might be due to some kind of digital gain that Sony puts in at higher ISOs, but I can't image that they'd so that with some channels and not with others, so I am at a loss to explain the low-resolution green channel and the blue channel results. A really bad ADC might miss some codes, but this is a 40,000 pixel sample (10,000 for each color plane), and probably is using several ADCs. I'm at a loss here.

Next up, the Sony NEX-7:

(http://www.kasson.com/ll/nex-7200x200histodarknoise.PNG)

Wow! We're seeing steps of about 16 LSBs between occupied buckets, but it's not exactly 16 LSBs, and it's not just as if the lower four bits have been lopped off.

Finally, the Nikon D800E:

(http://www.kasson.com/ll/d800E200x200histodarknoise.PNG)

This is interesting, because, although the channels are mostly looking like they'd been digitized with a 12-bit ADC, there are many places where adjacent 14-bit codes are occupied, indicating that the comblike nature of the histogram is not the result of any planned processing.

Maybe this is an invalid test because dark noise may be patterned, but I think there's something worth exploring here. The results for he M9 and D4 indicate that some cameras respond to this test in a way that you'd expect them to.

I'm not sure where to go from here, but I'm going to pursue this. It could have serious implications for what Unity Gain ISO should mean to photographers using the D800E and the two Sonys.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 28, 2013, 05:13:24 am
I got interested in the missing codes, and evaluated some exposures made with five different cameras under the same conditions. The subject was the back of a lens cap. The exposure was 1/4 sec. The aperture was all the way stopped down, just to make sure. The ISO was 6400. The exposures were the first after the camera had "rested" a bit, although I'd seen not much in the way of thermal effects previously. I selected a central area 200x200 pixels, and ran a histogram of the region between a count of 4 and one of 100.

I used dark noise as a way to make sure that the always-on-no-matter-what-you-do tone curve compresion of the Sony cameras wouldn't come into play.

Fabulous work, I always wondered exactly where the gaps in the low ADUs (i.e. where Raw 'gamma' is not applied) came from.

Quote
First, let's look at the two cameras that behaved as expected. The first of those is the Nikon D4.
A few missing codes in the red and blue channels, which could well be due to ADC defects, or also digital gain applied to the red and blue channels. I'm thinking it's digital gain, because the noise appears to be higher in the red and blue, and I can't think of a reason why that would happen.

Iliah Borg calls this WB preconditioning (watch the spelling ;-)  Is the measured standard deviation after you take into account zero blocking proportional to the size of the gaps?

Quote
The Sony RX-1 shows an interesting result:
...I'm at a loss here.

I also have no idea as to the dramatic difference in the population of the green and blue channels.  It's unlikely that you selected say 2 amp/ADC combos for G1 and B and 4 amp/ADC combos for G2 and R, right?  Is it a coincidence that the missing/existing codes alternate between G1 and B?

Quote
Next up, the Sony NEX-7:
Wow! We're seeing steps of about 16 LSBs between occupied buckets, but it's not exactly 16 LSBs, and it's not just as if the lower four bits have been lopped off.

They are all the exact same codes, even though unevenly spaced. If they were evenly spaced every sixteenth, say, could we say that Unity Gain was around ISO 400?  Sensorgen says that the NEX7 at ISO 6400 has FWC of 505 e- which would suggest a Unity Gain of around ISO 800.  Could the unevenness yet consistency of the codes indicate some kind of digital post processing?

Quote
Finally, the Nikon D800E:
This is interesting, because, although the channels are mostly looking like they'd been digitized with a 12-bit ADC, there are many places where adjacent 14-bit codes are occupied, indicating that the comblike nature of the histogram is not the result of any planned processing.

Maybe this is an invalid test because dark noise may be patterned, but I think there's something worth exploring here. The results for he M9 and D4 indicate that some cameras respond to this test in a way that you'd expect them to.

Yes, the tiny adjacent codes are intriguing.  One thing I may suggest if you haven't done so already is to explore the masked pixels for clues (check the relative box in RawDigger preferences to see them in files that it can handle).  As for dark noise, perhaps using a shorter shutter speed for the Nikons would help.  I read somewhere that Nikon subtracts data collected in the dark sensels to compensate for this before writing data to the Raw file.  Nikon supposedly also compensates for banding (don't know how) - could the tiny adjacent data be a leftover from those operations?

(http://i.imgur.com/YxBbYeW.jpg)

Quote
I'm not sure where to go from here, but I'm going to pursue this. It could have serious implications for what Unity Gain ISO should mean to photographers using the D800E and the two Sonys.

Jim
What about for the D4 and the M9?  Weren't you surprised that there were no systematic gaps proportional to gain beyond Unity Gain there?  For instance, according to sensorgen, there are 9 times as many linear Raw values as electrons in the D4 at ISO 6400, suggesting a unity gain of around ISO 700.  Where are the gaps?

And absent the gaps or with gaps that have nothing to do with it, what is the usefulness of Unity Gain?

Great stuff.  Looking forward to your thoughts.
Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 28, 2013, 06:24:21 am

Making the column 1000 pixels high shows no periodicity in the histogram.  I think that a definitive answer will need some more sophisticated analysis than histograms. Does anyone know a good way to turn raw files into 4 monochromatic TIFFs, preferably in batches? I'm not excited about using DCRAW. ImagesPlus?

Jim

Jim,

Iris (http://www.astrosurf.com/buil/us/iris/iris.htm) is a freeware astronomical program that can do the job. The split_cfa command separates the CFA into blue, red, and green1 and green2. It is a quite sophisticated program with a graphical interface. The list of commands is here (http://www.astrosurf.com/buil/us/iris/reference/commands_iris_v5.58.pdf). Many of these commands (including split_cfa) must be accessed from a command line rather than the graphical interface. I have not figured out how to use a batch mode, but it does have simple macro programing feature that takes parameters. The native file format is FIT (favored by astronomers), but it can save as TIFF.

ImagesPlus does have batch modes. It splits the CFA into three monochrome images, with the green channels combined (the green image is twice as large in the vertical dimension than horizontal. It costs $200, but does have a demo that you can try out.

Regards,

Bill
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 11:15:12 am
Iris (http://www.astrosurf.com/buil/us/iris/iris.htm) is a freeware astronomical program that can do the job...ImagesPlus does have batch modes. It splits the CFA into three monochrome images, with the green channels combined...

Thanks for the tip, Bill. I looked at the date of the last update on the Iris site and decided to buy a copy of ImagesPlus. When the selling price is in the low hundreds of dollars, the real cost of using a program like this is the time spent learning it. Actually, now that I think about it, that's true of Matlab, too, even though it costs a lot more.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 11:25:08 am
What about for the D4 and the M9?  Weren't you surprised that there were no systematic gaps proportional to gain beyond Unity Gain there?  For instance, according to sensorgen, there are 9 times as many linear Raw values as electrons in the D4 at ISO 6400, suggesting a unity gain of around ISO 700.  Where are the gaps?

Jack, there aren't any photon-created electrons in the test image; the inside of the camera was as near to a photon-free zone as I could make it. I think we're just looking at electrical noise, exacerbated by turning up the gain with the ISO control. You could consider the signal to be zero, and that bucket is so full that I had to cut it off the histogram so that you could see the other buckets. I could have used the log scale for the y axis, but sometimes that's confusing to people.

So, I'm not surprised. I'll be working on some images today with real photons, and not very many of them. Maybe we'll see gaps in the D4, but I'm betting the M9 noise will prevent that.

Also, I don't think we need to have SNRs greater than one in the deep shadows (a necessary condition for gaps) for Unity Gain ISO to make sense. But let's wait on that until I figure out what's going on with the D800E and the two Sonys.

Thanks for getting me started on this.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 28, 2013, 12:01:06 pm
Was back at the OP, struggling to understand the basic principle of the Method.

Still doing that, but while Googling, found this link which was highly relevant to high ISO and particularly the answer by jrista addressed the subject of unity gain very well and is quite relevant to this discussion. IMHO.

http://photo.stackexchange.com/questions/29675/what-is-so-special-about-iso-1600

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 28, 2013, 12:12:26 pm
I think that a definitive answer will need some more sophisticated analysis than histograms. Does anyone know a good way to turn raw files into 4 monochromatic TIFFs, preferably in batches? I'm not excited about using DCRAW. ImagesPlus?

Hi Jim, and others,

There are several software packages that can be of use, but one could use a combination of DCRaw to produce a non-demosaiced output file, and use ImageJ (http://imagej.nih.gov/ij/index.html) to do some image calculations (also allows to subtract image pairs).


should produce non-demosaiced, linear gamma, 16-bit TIFF output without the 'masked-pixels'. Replacing '-D' with '-E' should include those masked pixels.

In ImageJ, that tiff file can be split into 4 separate channel files with a simple Macro (see attachment), which is to be placed in the \ImageJ\plugins\Macros subdirectory. I've adapted the macro I found on the ImageJ discussion list (http://imagej.1557.n6.nabble.com/Splitting-raw-bayer-image-into-four-separate-color-plane-images-R-G1-G2-B-fixed-attached-images-td3683144.html#a4999662). I had to insert a short wait() time-out to avoid some images not getting shifted before getting resampled. Maybe it's caused by a parallel processing task getting out of sync.

One needs to verify that the channels are correctly named for a specific camera/Raw format/DCRaw conversion combination. The macro can be easily adjusted with a text editor. Different Raw formats may use a different order of the R/G1/B/G2 sensel filters, and different amounts of masked pixels can surround the effective image area. The attached macro seems to produce the same output pixel values as RawDigger does for my camera.

The benefit of using ImageJ is that the macro can be extended with all sorts of useful operations. One can e.g. subtract the 2 Green channels of an image of a diffusely lit smooth surface (after first adding an offset to the first image) as a means to eliminate pattern noise when only one image is available instead of an exposure pair specifically recorded for that purpose.

Hope that helps.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 12:33:31 pm
There are several software packages that can be of use, but one could use a combination of DCRaw to produce a non-demosaiced output file, and use ImageJ (http://imagej.nih.gov/ij/index.html) to do some image calculations (also allows to subtract image pairs).

Thanks, Bart, but I think I'm going to use Matlab for the image processing once I get the raw image planes. Not that it will be better than a specialized image processing program, but it's a program that I know (reasonably) well. I can't create those incredibly dense APL-like constructions, so real Matlab experts probably would look down on me, but the trade-off is that anyone with C++/Java experience can make sense of my code.

I looked at DCRAW, and went to a couple of the websites that offered compiled code, and was put off by the extra stuff that seemed to some with it. I don't want to buy a C compiler, and I'm -- probably unjustifiably so -- scared of using a free compiler that I don't know for sure is without side effects.

Call me chicken.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 12:47:47 pm
And absent the gaps or with gaps that have nothing to do with it, what is the usefulness of Unity Gain?

Jack, no matter what you think about the dithering effect of noise in the system, we do agree on one thing: there's a point at which you don't improve the SNR by turning up the ISO knob. If you think that noise dithering swamps out the theoretical gain in SNR of Unity Gain ISO, then you think that point comes sooner (at a lower ISO) than you do if you buy the whole Unity Gain ISO worldview. But either way, you stop twisting the knob.

Right?

By the way, if SNR is all that you're measuring, here's a D4 test that indicates that, five stops under clipping (http://blog.kasson.com/?p=2808), that, once you subtract out the effect of varying photon noise, there's no much change in SNR from ISO 100 through 6400. I now think that SNR, because of its insensitivity to quantizing depth in the presence of significant photon noise, is not the best tool for looking at noise, so take these curves with several grains of salt. I have some ideas for getting at the visual effects of the way noise and bit-depth interact, but I'm not ready to post anything on that yet.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 28, 2013, 12:59:37 pm
Jack, there aren't any photon-created electrons in the test image; the inside of the camera was as near to a photon-free zone as I could make it. I think we're just looking at electrical noise, exacerbated by turning up the gain with the ISO control. You could consider the signal to be zero, and that bucket is so full that I had to cut it off the histogram so that you could see the other buckets. I could have used the log scale for the y axis, but sometimes that's confusing to people.

Plenty of dithering power, then :)   I believe that the buckets around zero are so full because Nikon does not zero-offset the ADC, so it also records as positive the negative portion of the gaussian, skewing results around zero (see figure 11 here) (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p2.html#readandshot).  You can correct for that with some math (http://en.wikipedia.org/wiki/Folded_normal_distribution) to figure out the 'real' read noise.

So, I'm not surprised. I'll be working on some images today with real photons, and not very many of them. Maybe we'll see gaps in the D4, but I'm betting the M9 noise will prevent that.

Also, I don't think we need to have SNRs greater than one in the deep shadows (a necessary condition for gaps) for Unity Gain ISO to make sense. But let's wait on that until I figure out what's going on with the D800E and the two Sonys.

Thanks for getting me started on this.

Jim

My pleasure, looking forward to coming along for the ride.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 28, 2013, 01:05:29 pm
I looked at DCRAW, and went to a couple of the websites that offered compiled code, and was put off by the extra stuff that seemed to some with it. I don't want to buy a C compiler, and I'm -- probably unjustifiably so -- scared of using a free compiler that I don't know for sure is without side effects.

Call me chicken.

Hi Jim,

No problem, BTW I like chicks ;)

I simply use the precompiled binaries that are offered on several sites (e.g. http://www.insflug.org/raw/ (http://www.insflug.org/raw/)). The benefit over MathLab and some other commercial offerings is that DCRaw is freely available for everybody. I like it when everybody can participate and expand on each others findings.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 28, 2013, 01:09:41 pm
Jack, no matter what you think about the dithering effect of noise in the system, we do agree on one thing: there's a point at which you don't improve the SNR by turning up the ISO knob. If you think that noise dithering swamps out the theoretical gain in SNR of Unity Gain ISO, then you think that point comes sooner (at a lower ISO) than you do if you buy the whole Unity Gain ISO worldview. But either way, you stop twisting the knob.

Right?

Absolutely.  My thinking is that you stop twisting it when increasing analog gain no longer gives you a benefit in SNR in the shadows or you hit the ceiling with desirable highlights.  This is how Bill Claff puts it (http://home.comcast.net/~NikonD70/GeneralTopics/Sensors_&_Raw/Sensor_Analysis_Primer/Photographic_Dynamic_Range_Shadow_Improvement.htm).  Unity gain may be another way to achieve this or a similar objective, but I haven't quite understood how it would do it yet since there is no mention of noise in that equation, so I look forward to your tests and thought process. 
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Vladimirovich on March 28, 2013, 01:21:40 pm
Thanks, Bart, but I think I'm going to use Matlab for the image processing once I get the raw image planes. Not that it will be better than a specialized image processing program, but it's a program that I know (reasonably) well. I can't create those incredibly dense APL-like constructions, so real Matlab experts probably would look down on me, but the trade-off is that anyone with C++/Java experience can make sense of my code.

I looked at DCRAW, and went to a couple of the websites that offered compiled code, and was put off by the extra stuff that seemed to some with it. I don't want to buy a C compiler, and I'm -- probably unjustifiably so -- scared of using a free compiler that I don't know for sure is without side effects.

Call me chicken.

Jim

Jim, the same authors as for RawDigger are offering dcraw refactoring (dcraw -> C++ library) Libraw and there is a command line binaries compiled for you that do what you want :

http://www.libraw.org = http://www.libraw.org/download (there you can download a zip file and extract the content with precompiled binaries - in examples folder)

see for command line parameters = http://www.libraw.org/docs/Samples-LibRaw-eng.html
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 28, 2013, 03:13:05 pm
Still doing that, but while Googling, found this link which was highly relevant to high ISO and particularly the answer by jrista addressed the subject of unity gain very well and is quite relevant to this discussion. IMHO.

http://photo.stackexchange.com/questions/29675/what-is-so-special-about-iso-1600

Hi Ted, I believe this is the paragraph that you are referring to:

Quote
Gain is the conversion ratio of electrons (e-) to digital units (DU). A camera that converts exactly one e- to one DU has "unity gain".
Most cameras achieve unity gain at some exact (but possibly non-selectable) ISO setting.
More frequently, gain is fractional, such as 5.7 e- to every DU.  For every stop increase in ISO, gain drops by the same factor.
If you have a gain of 5.7 e-/DU at ISO 100, you would have 2.85 e-/DU at ISO 200, 1.425 e-/DU at ISO 400, .7125 e-/DU at ISO 800, and 0.35625 e-/DU at ISO 1600.

As you increase ISO, you lose signal to noise ratio (S/N). A lower S/N is never really a good thing...

Alright, here is an example.  We are at base ISO in manual mode and Exposure is already as big as it can be, chosen according to dof and blur constraints.  We take a test shot, look at our (fictitious) Raw histogram and realize that the brightest highlight we would like to keep is still two stops below clipping.  Do we increase ISO?

If one were to follow that quote above blindly one would not.  And they'd be leaving IQ at the scene.  Because for a fixed exposure, when you raise ISO the input referred read noise usually goes down (except in ISOless cameras) improving the shadows' SNR and overall DR - but only up to a point.  The key is determining the ISO past which the IQ no longer improves, because if you increase it past that point then all you are doing is waste space and possibly blow more highlights.

I believe that point is determined mainly by the physical characteristics of the analog 'amplification' in the conversion chain*.  Unity Gain exponents introduce an additional element unrelated to noise and suggest that in any case one should stop raising ISO when the chain produces 1 ADU for each electron from the sensor.  I don't quite understand why that should be a limit, probably because I am missing a piece of the puzzle.

Jack
*PS Bill Claff has developed a marvellous chart http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#D800E,EOS 5D Mark III (http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#D800E,EOS 5D Mark III) that shows graphically the improvement that one can expect from raising ISO in such situations for various cameras.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 28, 2013, 04:00:47 pm
Hi Ted, I believe this is the paragraph that you are referring to:

Quote
Gain is the conversion ratio of electrons (e-) to digital units (DU). A camera that converts exactly one e- to one DU has "unity gain".
Most cameras achieve unity gain at some exact (but possibly non-selectable) ISO setting.
More frequently, gain is fractional, such as 5.7 e- to every DU.  For every stop increase in ISO, gain drops by the same factor.
If you have a gain of 5.7 e-/DU at ISO 100, you would have 2.85 e-/DU at ISO 200, 1.425 e-/DU at ISO 400, .7125 e-/DU at ISO 800, and 0.35625 e-/DU at ISO 1600.

As you increase ISO, you lose signal to noise ratio (S/N). A lower S/N is never really a good thing...

Alright, here is an example.  We are at base ISO in manual mode and Exposure is already as big as [we care to set] according to dof and blur constraints.  We take a test shot, look at our (fictitious) Raw histogram and realize that the brightest highlight we would like to keep is still two stops below clipping.  Do we increase ISO?

I would say we increase ISO from base - simply because the scene is currently under-exposed by the said two stops.

Quote
If one were to follow that quote above blindly one would not.  And they'd be leaving IQ at the scene.  Because for a fixed exposure, when you raise ISO the input referred read noise usually goes down (except in ISOless cameras) improving the shadows' SNR and overall DR - but only up to a point.  The key is determining the ISO past which the IQ no longer improves, because if you increase it past that point then all you are doing is waste space and possibly blow more highlights.

Since we're talking numbers, how are you defining "IQ", SNR, DR or some combination thereof? This is a serious question, not a dig!

Quote
I believe that point is determined mainly by the physical characteristics of the analog 'amplification' in the conversion chain.

Sorry, the sentence is not very precise in engineering terms. However I do think I know what is meant and, since it encompasses the [entire] conversion chain, regretfully I can not comment.

Quote
Unity Gain exponents introduce an additional element unrelated to noise and suggest that, in any case, one should stop raising ISO when the chain produces 1 ADU for each electron from the sensor.  I don't quite understand why that should be a limit, probably because I am missing a piece of the puzzle.

Another question related to the first paragraph. Am I right or wrong in thinking that the 2 stops increase from base ISO in your example took us into Unity Gain+ territory?

A fascinating subject . . . well, for three of us anyway . . .
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 28, 2013, 04:18:09 pm
I would say we increase ISO from base - simply because the scene is currently under-exposed by the said two stops.

I am going to stop you right here: we are not underexposed because Exposure  (http://en.wikipedia.org/wiki/Exposure_value#Formal_definition)(determined solely by shutter speed and f/number) is as good as it gets and fixed: it's the biggest Exposure we could manage within our artistic constraints of dof (f/number) and blur (ss).  In other words we are not going to get any more photons/electrons/signal than this.  What we have is those photons/electrons being mapped to the Raw data so that the desirable highlights are recorded two stops below clipping.  Even so we can easily record scene information in all its glory because bit depth is only loosely linked to the amount of information recorded thanks to dithering ;).  The question is, is it the best we can do?

Jack

PS: IQ in this context is objective, quantifiable parameters like DR, SNR and blown vs retained desirable highlights.  And sure, let's assume that the two stops got you beyond unity gain. That doesn't mean you should get there :)
Title: Some Foveon results using ImageJ
Post by: xpatUSA on March 28, 2013, 05:05:02 pm

ISO 100 (base) at left, ISO 1600 at right. Linear 16-bit TIFFs from dcraw, opened in ImageJ and split into R, G & B images:

(http://kronometric.org/phot/exp/Foveon100y1600histRGB.gif)

Interesting that the condition: (mean = SD^2) would occur at less than 1600 ISO whereas Clark's method gives ISO 1880 for Unity Gain.

Any comment, Jim?

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on March 28, 2013, 05:07:14 pm
I believe that point is determined mainly by the physical characteristics of the analog 'amplification' in the conversion chain*.  Unity Gain exponents introduce an additional element unrelated to noise and suggest that in any case one should stop raising ISO when the chain produces 1 ADU for each electron from the sensor.  I don't quite understand why that should be a limit, probably because I am missing a piece of the puzzle.

Jack
*PS Bill Claff has developed a marvellous chart http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#D800E,EOS 5D Mark III (http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#D800E,EOS 5D Mark III) that shows graphically the improvement that one can expect from raising ISO in such situations for various cameras.

Raising the ISO is helpful with cameras having poorly matched electronics where the read noise increases at low ISO, as Emil shows in Fig 15a and the accompanying text in his article (http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p3.html#ETTR) on sensor noise and dynamic range. By raising the ISO, read noise is decreased initially and then levels off beyond a certain point. Increasing the ISO further does not decrease the read noise and only limits highlight headroom. The point of diminishing returns can be estimated by looking at the DXO plot of DR vs ISO and determining the ISO where the DR begins to drop by 1 stop for each doubling of the ISO.

Some in this thread have suggested that the unity gain is useful in determining this point of diminishing returns where increasing the ISO no longer decreases the read noise. However, unity gain has little to do with read noise. Many of the newer cameras using the Sony Exmor sensors are ISO less in that read noise does not vary with ISO and one does not need to bother with increasing the ISO on the camera, but can merely increase exposure in the raw converter. Unity gain has little utility with these cameras.

I determined unity gain for my D800e by a brute force, using Roger Clark's method (http://www.clarkvision.com/imagedetail/evaluation-1d2/index.html) for sensor analysis. For details, see Roger's post, but in brief, I took duplicate images at various ISOs of a uniform target illuminated by daylight coming in from a south facing window on a clear cloudless day where the illumination did not vary. I exposed at 1 EV over the meter reading get data where read noise and dark noise do not contribute significantly to the total noise, using a 300 mm lens at f/8 to reduce light falloff. I used ImagesPlus to isolate the 200x200 central area of the image and extract the green channel, and then subtracted duplicate images to obtain the photon noise. The number of captured photoelectrons equals the square of the signal:noise and one can determine the gain by dividing the number of electrons by the 14 bit data number. The results are shown. The unity gain can be estimated by the graph and occurs at about ISO 320.

Regards,

Bill
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 28, 2013, 05:13:12 pm
I am going to stop you right here: we are not underexposed because Exposure  (http://en.wikipedia.org/wiki/Exposure_value#Formal_definition)(determined solely by shutter speed and f/number) is as good as it gets and fixed.

OK. Thanks for the link.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 28, 2013, 05:26:37 pm
Some in this thread have suggested that the unity gain is useful in determining this point of diminishing returns where increasing the ISO no longer decreases the read noise. However, unity gain has little to do with read noise. Many of the newer cameras using the Sony Exmor sensors are ISO less in that read noise does not vary with ISO and one does not need to bother with increasing the ISO on the camera, but can merely increase exposure in the raw converter. Unity gain has little utility with these cameras.

Hi Bill, I agree.  In fact I'd extend your comment even to cameras that are not ISO less.  For instance, the 5DMIII has a Unity Gain of around ISO 500, but imho it would benefit greatly from raising ISO well into 2500 and above - as long as desirable highlights were not clipped.  Nevertheless I am sure that there is some merit to the unity-gain argument, and I would like to learn more to understand what that is.

I determined unity gain for my D800e by a brute force, using Roger Clark's method (http://www.clarkvision.com/imagedetail/evaluation-1d2/index.html) for sensor analysis. For details, see Roger's post, but in brief, I took duplicate images at various ISOs of a uniform target illuminated by daylight coming in from a south facing window on a clear cloudless day where the illumination did not vary. I exposed at 1 EV over the meter reading get data where read noise and dark noise do not contribute significantly to the total noise, using a 300 mm lens at f/8 to reduce light falloff. I used ImagesPlus to isolate the 200x200 central area of the image and extract the green channel, and then subtracted duplicate images to obtain the photon noise. The number of captured photoelectrons equals the square of the signal:noise and one can determine the gain by dividing the number of electrons by the 14 bit data number. The results are shown. The unity gain can be estimated by the graph and occurs at about ISO 320.

Your results agree perfectly with the analysis of full SNR data from DxO that I produced in the table in page three of this thread, where unity gain would have been attained at ISO 3.21*100=321.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 07:07:39 pm
Rather than use dark noise as a stimulus as in the preceding post, I have made a series of measurements of the histograms of the Nikon D4 and D800E, and the Sony RX-1 and NEX-7 when presented with a featureless surface eight or nine stops below clipping. I did not include the Leica M9 because I expect that it will perform pretty much like the D4, except with a lot more noise; if anyone would like to see that camera tested, let me know and I’ll oblige.

Each camera was measured with the camera ISO setting at all the whole stops from ISO 100 through ISO 6400. Shutter speeds were kept at 1/60 and faster to avoid any in-camera processing that might take place at slow shutter speeds. The central 200x200 pixels (10,000 pixels in each color plane) were used for the histogram. These tests have demonstrated to me that the histogram combing observed at high ISO settings in the previous post are due to two reasons:

    ADCs that, although they are specified as 14-bit devices, are not delivering 14 bits of resolution

    Digital gain applied by the camera manufacturers to the real raw data before it is written to the raw file.

The digital gain seems to be applied at very high ISOs, where there is so much noise that the l0ss in resolution of taking a  14-bit unsigned integer and multiplying it by a number less than 16 to yield another 14-bit unsigned integer probably does not adversely impact image quality.

One thing that surprised me is the Gaussian look to the noise in all cases. I had thought that the noise had longer tails than that from my dark noise tests.

Summary for the four cameras:

The Nikon D4 uses all 14 of its bits all the time except for those lost to digital white balance. There is no evidence of histogram periodicities that would indicate the elusive electron quanta, but with a sample that big, we've probably got several ADCs and several analog amplifiers involved. Details here (http://blog.kasson.com/?p=2926).

The Nikon D800E is at 14-bit device with all codes present except for those lost to digital white balance until the ISO knob gets to 3200. Then the gain of the analog amplifier stops increasing and the output of the ADC is shifter one bit to the left, giving thirteen bits of resolution. There is another one bit leftward shift and concomitant loss of resolution to 12 bits at ISO 6400. Details here (http://blog.kasson.com/?p=2932).

The Sony RX-1 is never a 14-bit instrument. It starts at 13 bits at ISO 100, and loses another bit in two of the channels at ISO 6400. Details here (http://blog.kasson.com/?p=2934).

The Sony NEX-7 starts out a 12-bit camera at ISO 100, is 11 bits at ISO 3200, and 10 bits at ISO 6400.  Details here (http://blog.kasson.com/?p=2937).

Jim



Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 07:17:52 pm
I determined unity gain for my D800e by a brute force, using Roger Clark's method (http://www.clarkvision.com/imagedetail/evaluation-1d2/index.html) for sensor analysis. For details, see Roger's post, but in brief, I took duplicate images at various ISOs of a uniform target illuminated by daylight coming in from a south facing window on a clear cloudless day where the illumination did not vary. I exposed at 1 EV over the meter reading get data where read noise and dark noise do not contribute significantly to the total noise, using a 300 mm lens at f/8 to reduce light falloff. I used ImagesPlus to isolate the 200x200 central area of the image and extract the green channel, and then subtracted duplicate images to obtain the photon noise. The number of captured photoelectrons equals the square of the signal:noise and one can determine the gain by dividing the number of electrons by the 14 bit data number. The results are shown. The unity gain can be estimated by the graph and occurs at about ISO 320.

And that's the result I got using the one-shot method that got me to start this post. That seems to be one thing we can all agree on. In the case of the two Sony's, I don't believe that they're 14-bit cameras anymore, and that means that the Unity Gain ISO for the RX-1 get's doubled, and the Unity Gain ISO for the NEX-7 gets quadrupled.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 28, 2013, 07:58:56 pm
Nevertheless I am sure that there is some merit to the unity-gain argument, and I would like to learn more to understand what that is.


Hi Jack,

The group of people who work with unity gain most are probably those involved with Astrophotography. They are faced with two major challenges (besides light-pollution).

The first is a lack of photons, so they would like to expose longer (collect more photons) to get the faint stars to get significantly brighter than the (background) noise floor. That brings us to the second issue, exposure time must be kept as short as possible to avoid atmospheric turbulence and perhaps residual tracking errors despite their special equatorial mounts. They also don't want to overexpose the brighter stars.

So they are caught in the middle, between exposure times that must be as long as possible but short enough to avoid motion issues. That's where ISO, or rather Gain, makes a difference. They take multiple exposures to reduce the noise by (amongst others) averaging, and boost the gain to amplify the weak signals and allow shorter exposure times. However, there is not much to be gained once those weak signals are sufficiently above the (lowered) noise floor, raising the gain further will increasingly add more amplifier and thermal noise which will make them again less visible.

In other words, they have little use for the situation where it takes several converted photons to change the ADU by only a single unit because that would require an unnecessarily long exposure time and an exponential growth of the dark current. There is also not much use for too much gain that separates single photon conversions by more than a single ADU, because it only risks getting more amplifier noise and temperature which won't improve accuracy one bit (pun intended).

That's why many of them aim for a setting of approximately unity gain or slightly above, because it's as accurate as useful, yet as low noise as possible.

Cheers,
Bart
Title: Re: Some Foveon results using ImageJ
Post by: Jim Kasson on March 28, 2013, 08:10:27 pm
Any comment, Jim?

Ted,

This isn't working very well for you, is it?

It looks to me that your ISO 100 histograms are broader than I would expect, and also not as smoothly Gaussian, which is what I would think they'd look like if the noise were all photon noise. Are you selecting the central 200x200 (or so) of an image that has no detail at all? I start with something that's flat-looking, and defocus the heck out of the lens to make sure. Also, as Bill Janes suggested earlier, a mean of 1000 would have less of a contribution from pixel response nonuniformity.  

Your ISO 1600 histograms have too low a mean, and are probably affected a great deal by read noise. They, too, should have a mean of about 1000. Here's the thing that confuses me, though; the SDs look too low, not too high.

Neither ISO is producing numbers that make sense. If you would, could you try again with a very flat subject, like a white wall? I'd be surprised if there were something about the Foveon that kept this method from working.

Sorry,

Jim



Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 28, 2013, 08:18:10 pm
The group of people who work with unity gain most are probably those involved with Astrophotography. They are faced with two major challenges (besides light-pollution).

Bart,

Astrophotographers often cool their sensors, don't they? As the read noise level drops, Unity Gain ISO assumes greater importance. As the noise goes up and up, at some point one or two photons either way need a lot of processing to be detected. I'm trying to sort out the visual effects, but I'll have to devise some new test to see if single electron changes in the sensor well can translate to visible differences in normal photographic images. I'm learning a lot with this exploration.

Jim
Title: Re: Some Foveon results using ImageJ
Post by: xpatUSA on March 28, 2013, 08:54:44 pm
Ted,

This isn't working very well for you, is it?

That's OK. I happened to have some X3F raw files of a Macbeth card shot for a different purpose and used those just to play with ImageJ. I selected the white patch in each case, and the mean values are what ImageJ said they were. In other words I hadn't adjusted the exposure to get the magic ~1000. I was actually on my way to delete the post anyway, so no harm done. I thought the Foveon images might be of interest with them not having two green channels to complicate matters.

I too was unable to make any sense of the relationship of the SD's to the means but, on re-examination, the distributions look skewed and there's quite a long 'tail' on the left . .

[added] X3F raw files are a trip in themselves - numbers bigger than 4095, weird meta data to do with normalizing the channels, channel saturation values that aren't, most folks just accept it and enjoy the images.

Thanks for your comments,

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 28, 2013, 09:55:35 pm
Bart,

Astrophotographers often cool their sensors, don't they?

Hi Jim,

Not necessarily/specifically, although cold nights generally do provide for lower atmospheric turbulence and they cool the setup down (and that causes condensation and battery capacity issues, but I digress). Many non-professional Astrophotographers use normal, non-adjusted DSLRs, some with only the IR filter removed from the IR+AA filter package.

Quote
As the read noise level drops, Unity Gain ISO assumes greater importance.

Absolutely. And by using things like averaging (just one of several steps), even random noise can be reduced a lot (a factor of 1/sqrt(N), where N is the number of exposures, often in the range of 16). Systematic noise (dead/hot pixels, dark current, other temporal noise, non-flatness of field) is removed by some of the other steps.

Quote
As the noise goes up and up, at some point one or two photons either way need a lot of processing to be detected. I'm trying to sort out the visual effects, but I'll have to devise some new test to see if single electron changes in the sensor well can translate to visible differences in normal photographic images. I'm learning a lot with this exploration.

While essential for Astrophotographers, the only benefit of using 'unity-gain' for regular photography is when we want to optimize the balance between noise quality AND short exposure time. Otherwise, just increase the number of Photons that get converted and the S/N ratio will offer a better image quality, or shorten the exposure time and get the shot to begin with. In the latter case, it may help to use a unity gain ISO setting, and underexpose if one can boost 'exposure' in post-processing (instead of cranking up the ISO setting).

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 29, 2013, 04:45:01 am
Each camera was measured with the camera ISO setting at all the whole stops from ISO 100 through ISO 6400. Shutter speeds were kept at 1/60 and faster to avoid any in-camera processing that might take place at slow shutter speeds. The central 200x200 pixels (10,000 pixels in each color plane) were used for the histogram. These tests have demonstrated to me that the histogram combing observed at high ISO settings in the previous post are due to two reasons:

    ADCs that, although they are specified as 14-bit devices, are not delivering 14 bits of resolution

    Digital gain applied by the camera manufacturers to the real raw data before it is written to the raw file.

The digital gain seems to be applied at very high ISOs, where there is so much noise that the l0ss in resolution of taking a  14-bit unsigned integer and multiplying it by a number less than 16 to yield another 14-bit unsigned integer probably does not adversely impact image quality.

Good stuff.  I assume that  just above you are referring to demosaicing and rendering, and of course I agree.  Another source of noise that I would assume would make the gaps imperceptible even at ISO 100 (as in the case of the two Sonys) is photon noise - shot noise inherent in the light hitting our retinas.

Quote
One thing that surprised me is the Gaussian look to the noise in all cases. I had thought that the noise had longer tails than that from my dark noise tests.

Perhaps with the shorter shutter speed dark noise is not as apparent, or perhaps it's corrected for.  Any clues as to what those tiny entries next to the main codes could be in the earlier histograms?

Quote
Summary for the four cameras:

The Nikon D4 uses all 14 of its bits all the time except for those lost to digital white balance. There is no evidence of histogram periodicities that would indicate the elusive electron quanta, but with a sample that big, we've probably got several ADCs and several analog amplifiers involved. Details here (http://blog.kasson.com/?p=2926).

I guess that's the typical real world situation with a CoC.  Would it be worthwhile to try to isolate an ADC/amplifier pair, perhaps with a smallish sample? I think that they are arranged in columns.  I'd be really interested to see whether we can approximately show one for one conversion.

Quote
The Nikon D800E is at 14-bit device with all codes present except for those lost to digital white balance until the ISO knob gets to 3200. Then the gain of the analog amplifier stops increasing and the output of the ADC is shifter one bit to the left, giving thirteen bits of resolution. There is another one bit leftward shift and concomitant loss of resolution to 12 bits at ISO 6400. Details here (http://blog.kasson.com/?p=2932).

The Sony RX-1 is never a 14-bit instrument. It starts at 13 bits at ISO 100, and loses another bit in two of the channels at ISO 6400. Details here (http://blog.kasson.com/?p=2934).

The Sony NEX-7 starts out a 12-bit camera at ISO 100, is 11 bits at ISO 3200, and 10 bits at ISO 6400.  Details here (http://blog.kasson.com/?p=2937).

The NEX-7 is surpirsing to me because it came out shortly after the D7k and K5 which used on-board 14-bit ADCs for the first time, so I thought it would use the same technology.  However its Raw data reaches full scale at only around DN4000 (it is spec'd as 12 bits).  Since at ISO 100 3/4 of the codes are missing, could we say that it is instead a 10-bit device?

Thanks for all your hard work and insights, this is great!

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 29, 2013, 04:54:47 am

Hi Jack,

The group of people who work with unity gain most are probably those involved with Astrophotography. They are faced with two major challenges (besides light-pollution).

The first is a lack of photons, so they would like to expose longer (collect more photons) to get the faint stars to get significantly brighter than the (background) noise floor. That brings us to the second issue, exposure time must be kept as short as possible to avoid atmospheric turbulence and perhaps residual tracking errors despite their special equatorial mounts. They also don't want to overexpose the brighter stars.

So they are caught in the middle, between exposure times that must be as long as possible but short enough to avoid motion issues. That's where ISO, or rather Gain, makes a difference. They take multiple exposures to reduce the noise by (amongst others) averaging, and boost the gain to amplify the weak signals and allow shorter exposure times. However, there is not much to be gained once those weak signals are sufficiently above the (lowered) noise floor, raising the gain further will increasingly add more amplifier and thermal noise which will make them again less visible.

In other words, they have little use for the situation where it takes several converted photons to change the ADU by only a single unit because that would require an unnecessarily long exposure time and an exponential growth of the dark current. There is also not much use for too much gain that separates single photon conversions by more than a single ADU, because it only risks getting more amplifier noise and temperature which won't improve accuracy one bit (pun intended).

That's why many of them aim for a setting of approximately unity gain or slightly above, because it's as accurate as useful, yet as low noise as possible.

Thank you Bart, that explains it.  Since they are able to reduce noise substantially through a combination of longish exposures and stacking, they lose its dithering action and therefore they are effectively in the ideal no-noise situation where one for one does indeed make sense.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 29, 2013, 05:20:06 am
Otherwise, just increase the number of Photons that get converted and the S/N ratio will offer a better image quality, or shorten the exposure time and get the shot to begin with. In the latter case, it may help to use a unity gain ISO setting, and underexpose if one can boost 'exposure' in post-processing (instead of cranking up the ISO setting).

I am trying to wrap my head around that statement and the situation where it would apply.  Here is an example to talk around: We are shooting hockey with a Canon 5DMIII with its lens fully open in an indoor arena.  The brightest highlight we are interested in is the white helmet of the players and in order to freeze their motion satisfactorily we need a shutter speed of 1/800s or shorter.  We take a test shot at ISO 100, look at our (fictitious, vendors!) Raw histogram and see that the helmets show up four stops below clipping.

In order to maximize IQ given our constraints we quickly evaluate noise in PP at various ISOs (better yet we look at this great chart by Bill Claff (http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#EOS 5D Mark III,D800E)) and decide to bump ISO up to ISO 1600 and shoot away.

Unity Gain for the 5DMIII is around ISO 500.  How would we use that knowledge to improve IQ?  Or would it apply more to a camera with the read noise profile of the D800e?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 29, 2013, 08:15:21 am
Jim (or Bill or Bart) . . .

I took more shots, this time OOF and a Kodak white card target. I found that ImageJ's (free version) histograms look funny until you finagle the bin width to be 1 raw image bit. For a shot at ISO 100, I got a result of x-bar (mean) and sigma (standard deviation) of 978 and 15.7 respectively which, if I understand the method presented in this topic correctly, gives a factor of about 4 thereby making a Unity Gain ISO of 400.

[edit]I made the "mistake" of setting the histogram to LIVE and moving the selection around in the image. Shouldn't have done that .  :-[ , the SD was changing by huge amounts - both making a nonsense of the above paragraph and showing me how horribly inconsistent the  image was; "was" being the operative word now.[/edit]

I had taken other shots at higher ISOs, but failed to remember that my LED lamps can vary their output at mains frequency. So I may redo the shots and set the custom WB to the card at the same time.

Am I correct to convert (in dcraw) to linear 16-bit TIFF for analysis? Is there a penalty for converting to 8-bit?

Had the Unity Gain ISO for my camera been truly 400 (ignoring Clark's method for the moment), should I have expected higher ISOs than 400 to have values of less than 1 for mean/SD^2 ?

Thanks,


Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 29, 2013, 09:35:47 am
I am trying to wrap my head around that statement and the situation where it would apply.  Here is an example to talk around: We are shooting hockey with a Canon 5DMIII with its lens fully open in an indoor arena.  The brightest highlight we are interested in is the white helmet of the players and in order to freeze their motion satisfactorily we need a shutter speed of 1/800s or shorter.  We take a test shot at ISO 100, look at our (fictitious, vendors!) Raw histogram and see that the helmets show up four stops below clipping.

Okay Jack,

That means we could use that setting, which allows to stop motion and doesn't blow out highlights, but the shadows would be very dark. We can boost the exposure in postprocessing, but then the very dark shadows will show lack of detail, and may drown in the read noise. There may be some 4 or more electrons averaged per ADU, but boosting exposure in postprocessing will not help the make a more accurate distinction in the shadows, the jumps from ADU to the next will still be a multiple of 4 or more electrons worth.

By increasing the Analog Gain we can reach Unity gain, where each single additional exposure electron produces a different ADU. We have gained accuracy, and lifted that detail higher above the noise floor. We now have better shadow detail, and the highlights are still not clipped. IOW, we've improved the accuracy of our signal, within the constraints that we couldn't increase the number of photons due to shuttertime, and we could amplify the signal without  introducing clipping, thus not lose useful dynamic range which was present in the scene (we did lose potential DR, but we didn't have enough signal to clip at the top due to shutterspeed). Mind you, the image is noisier, but it is random noise rather than read/pattern noise. Analog gain will determine the number of electrons per ADU.

Quote
In order to maximize IQ given our constraints we quickly evaluate noise in PP at various ISOs (better yet we look at this great chart by Bill Claff (http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#EOS 5D Mark III,D800E)) and decide to bump ISO up to ISO 1600 and shoot away.

Unity Gain for the 5DMIII is around ISO 500.  How would we use that knowledge to improve IQ?  Or would it apply more to a camera with the read noise profile of the D800e?

By boosting the gain with a factor of 16, we might have barely avoided highlight clipping, although the tail of the highlight shot noise might have clipped. However, the question becomes, what looks better: ISO 1600, or ISO 800 and a stop exposure correction in Raw conversion (plus a stop more highlight headroom for tweaking/recovery). It may even be interesting to test ISO 400 and a 2 stops Raw conversion exposure push. Raw converters may also handle the conversion differently based on ISO metadata.

Because of that reason, I once did a quick test of 3 scenarios on my 1Ds3. Image quality was only evaluated on the amount of noise after Raw conversion. The steps 1 through 6 mentioned, were the Grayscale Colorchecker patches 19 - 24:

Noise standard deviation of a 50x49 pixel area of each patch.
(http://www.xs4all.nl/~bvdwolf/temp/OPF/HighISO+Push.png)

As can be seen, the ISO 400 has lower noise than the ISO 800 group, and the ISO 800 group has lower noise than the ISO 1600 group. Within the ISO 800 group, there is little difference between the underexposed + pushed in post setting, but the pushed settings will have more highlight clipping latitude (a stop headroom) at capture time. Within the ISO 1600 group there is also little difference, although the ISO 800 pushed 1 stop is slightly better than the rest, and again it has 1 stop overexposure headroom. Even ISO 400 pushed 2 stops is a bit better than the ISO 1600 gain setting.

The differences within each 'ISO group' are actually very difficult to see, but they are measurable. The differences between the groups are more distinct, visually. For me that made it clear that ISO 400 was good enough (for the rare occasion that I need higher ISOs) with still the potential to boost 1 or 2 stops in post processing with little loss compared to a higher ISO setting to begin with, because the Unity gain of the 1Ds3 is approx. reached at ISO 400.

That's how I see a practical implementation of what we can do with the knowledge about 'Unity Gain' for a specific camera.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 10:46:59 am

Each camera was measured with the camera ISO setting at all the whole stops from ISO 100 through ISO 6400. Shutter speeds were kept at 1/60 and faster to avoid any in-camera processing that might take place at slow shutter speeds. The central 200x200 pixels (10,000 pixels in each color plane) were used for the histogram. These tests have demonstrated to me that the histogram combing observed at high ISO settings in the previous post are due to two reasons:

    ADCs that, although they are specified as 14-bit devices, are not delivering 14 bits of resolution

    Digital gain applied by the camera manufacturers to the real raw data before it is written to the raw file.

The digital gain seems to be applied at very high ISOs, where there is so much noise that the l0ss in resolution of taking a  14-bit unsigned integer and multiplying it by a number less than 16 to yield another 14-bit unsigned integer probably does not adversely impact image quality.


Good stuff.  I assume that  just above you are referring to demosaicing and rendering...

Actually not. I reached the above conclusions by looking at the individual bit planes of raw images.  I never looked at a rendered image in this series.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 11:02:51 am
Any clues as to what those tiny entries next to the main codes could be in the earlier histograms?

None at all. I'll see if they recur.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 11:11:24 am
The NEX-7 is surprising to me because it came out shortly after the D7k and K5 which used on-board 14-bit ADCs for the first time, so I thought it would use the same technology.  However its Raw data reaches full scale at only around DN4000 (it is spec'd as 12 bits).  Since at ISO 100 3/4 of the codes are missing, could we say that it is instead a 10-bit device?

Jack, RawDigger treats the NEX-7 like a 14-bit device, with a full scale count of slightly over 16000.  I thought it was a 14-bit camera. Now I see that you are right; it is specified as a 12-bit camera. The EXIF data in the raw files specifies the bit-depth as 12 bits. At ISO 100 3/4 of the 14-bit codes are missing, but all of the 12-bit codes are present. At ISO 3200, we lose the first 12-bit LSB, and at ISO 6400, we lose the second 12-bit LSB.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 11:18:09 am
For a shot at ISO 100, I got a result of x-bar (mean) and sigma (standard deviation) of 978 and 15.7 respectively which, if I understand the method presented in this topic correctly, gives a factor of about 4 thereby making a Unity Gain ISO of 400.

ISOug is 397 by calculation from your numbers, so you are absolutely right. Does that make sense?

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 11:22:28 am
Am I correct to convert (in dcraw) to linear 16-bit TIFF for analysis? Is there a penalty for converting to 8-bit?

Yes to both questions. Your standard deviations won't be accurate with the size of the histogram bucket increased from one count to 16. It's 16 since you have a 12-bit camera. If you had a 14-bit camera, the 8-bit bucket would be 2 ^ ( 14 - 8 ), or 64 counts.

One thing you have to make sure you do if you don't look directly at the raw color planes in a program like RawDigger is make sure that whatever program does the conversion does not change the color space from the original camera color space. If you go to, say, Adobe RBG, you'll have contributions from various camera color planes mixed into the Adobe RGB color planes.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 11:24:05 am
Had the Unity Gain ISO for my camera been truly 400 (ignoring Clark's method for the moment), should I have expected higher ISOs than 400 to have values of less than 1 for mean/SD^2 ?

Yes. Take a look at the graph below, which has test ISOs both above and below the unity gain ISO. BTW, this graph assumes that the RX-1 is a 14-bit camera. Since my copy appears to be a 13-bit camera, the unity gain ISO is really about 800.

(http://www.kasson.com/ll/RX-1ISOUGain5stopsFrom%20Clipping.PNG)

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: qwz on March 29, 2013, 01:40:39 pm
The NEX-7 is surpirsing to me because it came out shortly after the D7k and K5 which used on-board 14-bit ADCs for the first time, so I thought it would use the same technology.  However its Raw data reaches full scale at only around DN4000 (it is spec'd as 12 bits).  Since at ISO 100 3/4 of the codes are missing, could we say that it is instead a 10-bit device?


Sony cameras after Alpha 900/850 uses lossy compression in RAW. It's pretty tricky but efficient. I tested with my a900 cRAW and RAW and found virtually no difference. But 14bit claimed in a99 worked only on single shot mode. And it is a definitely difference in usable range in deep shadows compared to 12bit.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 01:59:22 pm
Jack, it's early days here, but I have the first results looking for the elusive single electron. Here's an image from the D4 with ISO set to 640, which is pretty close to the unity gain ISO. It's underexposed. In fact, it's so underexposed that the average difference between the dark and the light areas is 1.25 electrons in the green channel, about one electron in the blue channel, and less than half an electron in the red channel. I brought it into ACR and gave it 5 stops of plus exposure, then hit it with an aggressive curve in Photoshop. The curve just changed the white point. In neither this one or the one that follows  did I touch the black point.

(http://www.kasson.com/ll/_D429478sm.jpg)

"OK", you say, "But that's the power of averaging. What would happen with the ISO set to 100, so each step in the histogram would be more than 6 electrons?" I'm glad you asked. Here is an image with a little more light -- 2 green electrons average difference, with the other channels scaled. Note that the green channel difference is now less than one-third of a count.

(http://www.kasson.com/ll/_D429481sm.jpg)

We've lost some contrast, but we're also missing that really ugly red artifact.

This is going to take some more work, but your instincts that the read noise could create useful dither appear to be right on.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 29, 2013, 02:58:29 pm
[Am I correct to convert (in dcraw) to linear 16-bit TIFF for analysis? Is there a penalty for converting to 8-bit?]

Yes to both questions. Your standard deviations won't be accurate with the size of the histogram bucket increased from one count to 16. It's 16 since you have a 12-bit camera. If you had a 14-bit camera, the 8-bit bucket would be 2 ^ ( 14 - 8 ), or 64 counts.

One thing you have to make sure you do if you don't look directly at the raw color planes in a program like RawDigger is make sure that whatever program does the conversion does not change the color space from the original camera color space. If you go to, say, Adobe RBG, you'll have contributions from various camera color planes mixed into the Adobe RGB color planes.

Thanks again, Jim.

I need to improve my test images, so working on that. I'm still using dcraw to convert the X3F file because it does the least NR. Outputting 16-bit TIFF, RGB color space (not sRGB nor ARGB) with no other processing. Opening in ImageJ and splitting into the three RGB windows and then analyzing each window. Haven't averaged anything yet, still lining up the ducks . .

The ISOug of 400 made no sense compared to Clark's 1880 for my large-capacity wells 77,000e- and 12-bit ADCs (one per color on the Sigma SD10). I attribute the nonsense to my bad images. Next considering shooting my monitor per Claff.

I'll be looking for an SD of sqrt(1000e-/18.8 ) = about 7 which I have seen in my tours around the current image. One thing that's good about ImageJ live histogram view is that you can see the shape of the distribution change as you move the selection rectangle, obviously preferring Gaussian . .

I'll be baack!





Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 03:05:49 pm
Next considering shooting my monitor per Claff.

That's what I usually do when shooting targets. Use a longish lens -- about 135mm full frame or equivalent. Use a slowish shutter speed so you get multiple refreshes per exposure. Not so long that your camera's noise reduction comes into play. I like 1/30. Defocus. Use only a central area.

Good luck!

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 29, 2013, 05:54:20 pm
Jack, it's early days here, but I have the first results looking for the elusive single electron. Here's an image from the D4 with ISO set to 640, which is pretty close to the unity gain ISO. It's underexposed. In fact, it's so underexposed that the average difference between the dark and the light areas is 1.25 electrons in the green channel, about one electron in the blue channel, and less than half an electron in the red channel. I brought it into ACR and gave it 5 stops of plus exposure, then hit it with an aggressive curve in Photoshop. The curve just changed the white point. In neither this one or the one that follows  did I touch the black point.

Fabulous example, Jim.  I understand that LR/ACR is less than ideal for this type of push because it applies different curves/profiles depending on ISO and EC applied -  and it twists hues (http://dcptool.sourceforge.net/Hue%20Twists.html).  How does it look in a neutral converter like RawTherapee?

Quote
"OK", you say, "But that's the power of averaging. What would happen with the ISO set to 100, so each step in the histogram would be more than 6 electrons?" I'm glad you asked. Here is an image with a little more light -- 2 green electrons average difference, with the other channels scaled. Note that the green channel difference is now less than one-third of a count.

We've lost some contrast, but we're also missing that really ugly red artifact.

Yes, according to Bill Claff's Shadow Improvement chart (http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#D4), the D4 benefits substantially from increasing ISO to 800 and then marginally beyond that.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 29, 2013, 06:13:56 pm
By boosting the gain with a factor of 16, we might have barely avoided highlight clipping, although the tail of the highlight shot noise might have clipped. However, the question becomes, what looks better: ISO 1600, or ISO 800 and a stop exposure correction in Raw conversion (plus a stop more highlight headroom for tweaking/recovery). It may even be interesting to test ISO 400 and a 2 stops Raw conversion exposure push. Raw converters may also handle the conversion differently based on ISO metadata.

Because of that reason, I once did a quick test of 3 scenarios on my 1Ds3. Image quality was only evaluated on the amount of noise after Raw conversion. The steps 1 through 6 mentioned, were the Grayscale Colorchecker patches 19 - 24:

Noise standard deviation of a 50x49 pixel area of each patch.
(http://www.xs4all.nl/~bvdwolf/temp/OPF/HighISO+Push.png)

As can be seen, the ISO 400 has lower noise than the ISO 800 group, and the ISO 800 group has lower noise than the ISO 1600 group. Within the ISO 800 group, there is little difference between the underexposed + pushed in post setting, but the pushed settings will have more highlight clipping latitude (a stop headroom) at capture time. Within the ISO 1600 group there is also little difference, although the ISO 800 pushed 1 stop is slightly better than the rest, and again it has 1 stop overexposure headroom. Even ISO 400 pushed 2 stops is a bit better than the ISO 1600 gain setting.

The differences within each 'ISO group' are actually very difficult to see, but they are measurable. The differences between the groups are more distinct, visually. For me that made it clear that ISO 400 was good enough (for the rare occasion that I need higher ISOs) with still the potential to boost 1 or 2 stops in post processing with little loss compared to a higher ISO setting to begin with, because the Unity gain of the 1Ds3 is approx. reached at ISO 400.

That's how I see a practical implementation of what we can do with the knowledge about 'Unity Gain' for a specific camera.

Thanks Bart, excellent write up.  I get your point about accuracy, although I wonder what that means in the real world since noise in the gain/ADC stage would apparently swamp it.  I do feel however that the table doesn't do justice to the issue at hand because it looks at non-raw data polluted by subjective rendering parameters and the 1Ds3 has a shadow improvement curve that gives diminishing returns past unity-gain ISO of about 400.

[EDIT: please see my post about multiple gain stages a bit further down]
According to sensorgen the 1Ds3's read noise improves by 1.5 stops between ISO 100 and 400 but only 0.6 of a stop between 400 and 3200.

I chose the 5DIII on purpose for the exercise because its shadows improve 1.6 stops from 100 to 500 ISO and then an additional stop from 500 to 1600 - with unity gain at around 500.  So with a unity-gain strategy one would stop at ISO 500, while with a shadow-improvement strategy one would take it all the way to ISO 1600, allegedly gaining an additional stop of SNR in the shadows.  I unfortunately have neither camera to try this out on :([\s]

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 29, 2013, 06:43:19 pm
Sony cameras after Alpha 900/850 uses lossy compression in RAW. It's pretty tricky but efficient. I tested with my a900 cRAW and RAW and found virtually no difference. But 14bit claimed in a99 worked only on single shot mode. And it is a definitely difference in usable range in deep shadows compared to 12bit.

Interesting.  I thought that this type of 'gamma' compression did not kick in but well after the deep shadows (http://www.openphotographyforums.com/forums/showthread.php?t=5499).
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 06:50:52 pm
Interesting.  I thought that this type of 'gamma' compression did not kick in but well after the deep shadows (http://www.openphotographyforums.com/forums/showthread.php?t=5499).

Me, too.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 29, 2013, 07:17:18 pm
That's how I see a practical implementation of what we can do with the knowledge about 'Unity Gain' for a specific camera.

Bart, I have a similar noise-based way of deciding when to stop turning up the ISO that has nothing to do with unity gain, although my targets are much simpler; just one D65 patch. I'll give you an example for the RX-1, which yields results similar to what unity gain would say.

I first do a series of exposures of the target at various ISOs, using only the central 200x200 pixels, and holding the digital values constant, in this case 5 stops below clipping for the green channel. That means every time I increase the ISO by a stop, I have to stop down a stop (because I'm compensating for the read noise, which varies with shutter speed, I hold the shutter speed constant.) I get curves like this:

(http://www.kasson.com/ll/RX1ISOseries5stopsfromclippingSNRonly.PNG)

Then I subtract out the half-a-stop-per-stop slope that's occurring because, for each stop increase in ISO, there are half as many photons. That gives me this:

(http://www.kasson.com/ll/RX1ISOseries5stopsfromclippingImprovement.PNG)

The highest point on the curve gives me the place where I should think about not turning my ISO up any further. You can see in this case that there's very broad latitude. The peak, if you want to call such a broad top a peak, is near the unity gain ISO of about 800. (I measured 400 and change, but now I think my RX-1 is for all intents and purposes a 13-bit camera.)  

I do have one concern with this test, however. I've noticed that SNR holds up remarkably well as resolution decreases, if the noise is big enough. Thus, the SNR at low ISOs might look good, but there could be some posterization. It remains a strictly theoretical worry, though; I've never seen any evidence of it. Here's a five-stop series from ISO 100 to ISO 3200 with the D800 that doesn't show any that I can see. (http://blog.kasson.com/?p=2739)  [Edit: I just noticed that the whole image from which the crops were made isn't on that page. It's here (http://blog.kasson.com/?p=2729).]

Here are the D800 curves that made me think I could get away with that:

(http://www.kasson.com/ll/D800EISOseries5stopsfromclippingImprovement.PNG)

Jim

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 30, 2013, 06:45:08 am
Bart, I have a similar noise-based way of deciding when to stop turning up the ISO that has nothing to do with unity gain, although my targets are much simpler; just one D65 patch. I'll give you an example for the RX-1, which yields results similar to what unity gain would say.

I first do a series of exposures of the target at various ISOs, using only the central 200x200 pixels, and holding the digital values constant, in this case 5 stops below clipping for the green channel. That means every time I increase the ISO by a stop, I have to stop down a stop (because I'm compensating for the read noise, which varies with shutter speed, I hold the shutter speed constant.) I get curves like this:

Jim, what I believe you have done is replicated the 18% SNR curves at DxO - in your case at around 3.2% (-5 stops) of full scale. 

Quote
Then I subtract out the half-a-stop-per-stop slope that's occurring because, for each stop increase in ISO, there are half as many photons. That gives me this:

(http://www.kasson.com/ll/RX1ISOseries5stopsfromclippingImprovement.PNG)


The highest point on the curve gives me the place where I should think about not turning my ISO up any further. You can see in this case that there's very broad latitude. The peak, if you want to call such a broad top a peak, is near the unity gain ISO of about 800. (I measured 400 and change, but now I think my RX-1 is for all intents and purposes a 13-bit camera.)

The highest point on the curve represents the cleanest spot of just photon noise, as unpolluted as possible by read noise or PRNU, which can be seen here as the red and green patches at the tip and tail end of the (unstraightened) curves, where they drop just like in yours:

(http://i.imgur.com/4sLIzwF.jpg)

The vertical line with the dots represents your approximate sample points at -5 stops form FS.  Does the area cleanest of camera-induced noise on an SNR curve correspond to unity gain?*  Would your results differ if instead of 5 stops below full scale you had chosen 7 or 8 stops below clipping as your reference?

Quote
I do have one concern with this test, however. I've noticed that SNR holds up remarkably well as resolution decreases, if the noise is big enough. Thus, the SNR at low ISOs might look good, but there could be some posterization. It remains a strictly theoretical worry, though; I've never seen any evidence of it. Here's a five-stop series from ISO 100 to ISO 3200 with the D800 that doesn't show any that I can see. (http://blog.kasson.com/?p=2739)  [Edit: I just noticed that the whole image from which the crops were made isn't on that page. It's here (http://blog.kasson.com/?p=2729).]

Here are the D800 curves that made me think I could get away with that:

I have looked and looked at pairs of Exmor captures, one taken at classic ISOs the other with the same exposure but at base ISO and pushed 4-5-6 stops in post by a neutral raw converter.  Here is an early example by Guillermo Luijk with a K5 (http://www.luminous-landscape.com/forum/index.php?topic=49200.msg406279#msg406279).  Anybody who has not tried this should download the available Raw files and open them in RawTherapee to judge for themselves.  View them as you would normally view such an image, but do push it around to try to see the underlying differences.

As I mentioned earlier, it is really, really difficult to see a difference in normal conditions, and when I do see them in my opinion one image is not necessarily preferable to the other.  Guillermo's image show a little more chroma noise and zero blocking.  The base ISO file was understandably much smaller in size, though it appeared to have captured virtually the same image information, meaning that the rest of the data in the 'classic' ISO file was mostly noise.

Jack
* Intuitively I would say not for practical intents and purposes, because any quantization induced by the discrete nature of electrons would be averaged out through dithering by the LSB-sized noise in the gain/ADC chain.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 30, 2013, 07:02:54 am
Bart, upon further thought I now believe that my question about the 5DIII or in fact most Canon DSLRs is not useful for the issue at hand, since I understand that they employ a two stage analog amplifier design, complicating things unnecessarily.  Let's stick to single amplifier designs for simplicity.  What do you think about my comment to Jim above?

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 30, 2013, 11:36:04 am
Bart, I have a similar noise-based way of deciding when to stop turning up the ISO that has nothing to do with unity gain, although my targets are much simpler; just one D65 patch.

Hi Jim,

I prefer your current presentation over the above quicky that I did some 4 years ago. Despite a larger number of variables (non-uniformity of the CC patches, light/exposure, and the Raw converter) in my test, total noise also approaches a more constant build up at or above unity gain, but it also illustrates an overall increase of the noise level. Your presentation allows to find a sweet-spot (if there is one) in the S/N ratio, which is very useful for Astrophotography, because the overall noise which may be a distraction (and problematic for sharpening) in regular photography can be reduced by averaging multiple exposures quite dramatically.
 
I've read your blog, and am pleased to see the progress you've made in finding a relatively easy to interpret graphical form to express the complexities underneath. I'm also pleased with the attention given to characterizing/reducing methodological errors with respect to sensor temperature and shutter speed variations.

The only improvement I can currently think of is an elimination (or at least determination) of the influence of non-uniformity of the light-source and lens vignetting, and sensels (PRNU / sensor dust / dead- or hot pixels), in the central crop area used for analysis. The only way would be to do a check with subtracted image pairs (and Stdev/Sqrt(2)), or (slightly less accurate but still informative) a comparison between the 2 Green filtered sensel sub-images. It may reveal that your current results do not vary much from an even more normalized data-set, but dust and PNRU do keep lurking around the corner, waiting to strike.

I find e.g. that there is a (negligible) small systematic difference in the mean sensel values from the G1 and G2 sensels of my 1Ds3 camera, the G1 sensels on average give an up to 1.605 ADU higher response than the G2 sensels. It's nice to know that this will usually not bias the noise statistics in a noticeable way, but still there is a difference. It also does allow to reveal shortcomings in isolated Green filtered sensels in the area under investigation, which may influence small crop area results (see attachment, with seriously boosted contrast, which reveals a slightly less responsive G1 sensel).

Quote
I first do a series of exposures of the target at various ISOs, using only the central 200x200 pixels, and holding the digital values constant, in this case 5 stops below clipping for the green channel. That means every time I increase the ISO by a stop, I have to stop down a stop (because I'm compensating for the read noise, which varies with shutter speed, I hold the shutter speed constant.)

There is a slight (nitpicking) concern here. By varying the aperture you do avoid effects from dark current and potentially Raw converters that are not really giving the same type of Raw data at all exposure times. Unfortunately at the same time you introduce a variable in light uniformity over the selected area due to vignetting. You can minimize that effect by taking only a small crop at the center of the image (assuming the light fall-off is symmetrical). But the smaller the crop becomes, the larger a few outliers will influence the statistics. Another potential source of non-uniformity is that there may be a slight asymmetry in the aperture that the (partially sticky) blades of the iris leave open, and there may be a less than perfectly linear progression in the amount of light that's let through (narrower aperture also require longer to close, hopefully to a repeatable final position). Another issue is that at apertures wider than approx. f/3.5, the analog gain of some cameras seems to be increased ...!

Quote
I do have one concern with this test, however. I've noticed that SNR holds up remarkably well as resolution decreases, if the noise is big enough.

I'm not sure which resolution you have in mind, so I can't comment on that.

All in all, a very useful exercise and helpful presentation, and it (as usual) learns us a lot about our tools. Do take my remarks a encouragement and not a criticism, because I know how much time it takes to do these things right.

I don't know if Iliah Borg happens to stumble across this exchange, but I would love it if a G1 vs G2 metric could be added to RawDigger. Just a number giving the mean of the G1-G2 differences in a selected area, and the standard deviation of the result divided by Sqrt(2). A large non-zero mean indicates a calibration issue if measured of a uniform patch, and a smaller standard deviation than that of the G1 or G2 sensels suggests the presence of PRNU or of uneven lighting that injects an upward bias in the noise statistics.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 30, 2013, 12:16:15 pm
Jim, what I believe you have done is replicated the 18% SNR curves at DxO - in your case at around 3.2% (-5 stops) of full scale.

Hi Jack,

Yes, but with an arrangement that's more useful for the topic at hand, and with a few additional pieces of information. 

Quote
The highest point on the curve represents the cleanest spot of just photon noise, as unpolluted as possible by read noise or PRNU, which can be seen here as the red and green patches at the tip and tail end of the (unstraightened) curves, where they drop just like in yours

Correct, but that may well coincide with the Unity Gain level, the underlying hypothesis of the usefulness of knowing that metric. Perhaps it's easier to determine the Unity Gain than the optimal SNR trade-off. Nevertheless, it's probably more important to know the real optimal Photon noise versus camera noise trade-off point, as far as it's controlled by the ISO setting, although it may be different at various level of exposure. However, do note that the overall noise level at a certain ISO setting may be objectionable from an aesthetical point of view, even though the objective SNR is optimal. It's still a trade-off, and collecting more photons will always give better quality.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 30, 2013, 12:19:28 pm
Bart, upon further thought I now believe that my question about the 5DIII or in fact most Canon DSLRs is not useful for the issue at hand, since I understand that they employ a two stage analog amplifier design, complicating things unnecessarily.

Hi Jack,

I agree, but it is still very relevant for Canon owners and for future camera models that may emerge.

Quote
Let's stick to single amplifier designs for simplicity.  What do you think about my comment to Jim above?

See my comments posted just before this answer.

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 01:09:05 pm
Does the area cleanest of camera-induced noise on an SNR curve correspond to unity gain?

Jack,

For the RX-1 it happens to, at least with the input five stops down from clipping, but for the NEX-7, it does not:

(http://www.kasson.com/ll/NEX-7ISOseries-6stopswithUGISO.jpg)

By the way, you wondered what would happen if the stimulus was a little darker. You can get a sense of that by looking at the blue curve which averages 312/467 = 2/3 of a stop down from the green, and the red curve, which averages 183/457 = 1 1/3 stop down from the green. Not as far down as you wanted to go, but it's some more information.

Also by the way, I believe the reason the ISO 6400 points jump up like they do is because there is some noise reduction that the camera does at that ISO that you can't turn off.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 01:16:33 pm
After taking many shots by various means, I have given up on the Grail of measuring the ISOug of a Foveon-based camera.

Ted,

I'm sorry the method didn't work with the Fovean-based cameras. I thank you for your patience and for doing a great job of researching the difficulties. I will note your findings on my blog to save others the frustration.

Thanks again,

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 01:23:03 pm
The only improvement I can currently think of is an elimination (or at least determination) of the influence of non-uniformity of the light-source and lens vignetting, and sensels (PRNU / sensor dust / dead- or hot pixels), in the central crop area used for analysis. The only way would be to do a check with subtracted image pairs (and Stdev/Sqrt(2)), or (slightly less accurate but still informative) a comparison between the 2 Green filtered sensel sub-images. It may reveal that your current results do not vary much from an even more normalized data-set, but dust and PNRU do keep lurking around the corner, waiting to strike.

Bart, I now recognize this as a deficiency. I plan to do what I can to fix it, but it will take me at least a few days.  Right now I don't have a good way to do the calculations, but help is on the way.  Thanks for your help with all this.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 01:45:51 pm
There is a slight (nitpicking) concern here. By varying the aperture you do avoid effects from dark current and potentially Raw converters that are not really giving the same type of Raw data at all exposure times. Unfortunately at the same time you introduce a variable in light uniformity over the selected area due to vignetting. You can minimize that effect by taking only a small crop at the center of the image (assuming the light fall-off is symmetrical). But the smaller the crop becomes, the larger a few outliers will influence the statistics. Another potential source of non-uniformity is that there may be a slight asymmetry in the aperture that the (partially sticky) blades of the iris leave open, and there may be a less than perfectly linear progression in the amount of light that's let through (narrower aperture also require longer to close, hopefully to a repeatable final position).

You raise some concerns that I never thought of, and one that I've considered and corrected for. I do take a 200x200 pixel area in the center of the image as my region of concern. That gives me 10,000 pixels in each color plane, which seems to be good compromise. If there's aperture shape effects or differential vignetting, I don't correct for that. I could perform some measurements to see what's going on, though.

I did consider the possibility that the aperture varies from precisely the set f-stop, and, on the two cameras that open their diaphragms between exposure, that there's exposure to exposure variation. I didn't go into that on my blog or here because I thought it was a pretty nerdy detail, but I will now. It's the source of the word "corrected" on some of my charts.

For the entire ISO series, 16 exposures times the number of ISO settings tested, I compute the average count for the red, green, and blue channels. For every exposure, I compute a corrected count by dividing the raw count by the average count for that channel. I divide each raw count by the correction factor for that exposure to get a corrected count. I divide each raw standard deviation by the square root of the correction factor for that exposure to get a corrected standard deviation. I use the corrected count and the corrected standard deviation for the SNR calculations.

Basically, I'm making small corrections for the SNRs based upon how the measured exposure errors would affect a photon-noise-limited (perfect) camera. I think of it as kind of a model-mediated one-step Newton's method.

Another issue is that at apertures wider than approx. f/3.5, the analog gain of some cameras seems to be increased.

Oops! I didn't know that. At least it won't affect the M9 results, since the camera can't figure out where the aperture is set.

Thanks,

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on March 30, 2013, 02:16:54 pm
Oops! I didn't know that. At least it won't affect the M9 results, since the camera can't figure out where the ISO is set.

Hi Jim,

It's not a huge effect (http://www.luminous-landscape.com/forum/index.php?topic=47800.msg398232#msg398232) (<1/3rd of a stop worth) as far as my camera is concerned, but these small variables add up. Besides, we never know what other cameras do or will do in the future, so it's best to either detect it (calibrate for aperture used per camera model) or avoid it. Maybe the small errors due to shutter time are relatively smaller and more gradual (=predictable) afterall?

Cheers,
Bart
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 30, 2013, 02:52:45 pm
Jack,

For the RX-1 it happens to, at least with the input five stops down from clipping, but for the NEX-7, it does not:

Yes, the RX-1 does appear to have a read noise sweetspot around ISO 800, and I calculate its Unity-Gain at around that based on a 13 bit ADC:

(http://i.imgur.com/kZGF8af.jpg)

The D800e's read noise minimum doesn't correlate at all with its Unity-Gain, though, and neither do some of the other Exmor Nikons I've looked at.

Quote
By the way, you wondered what would happen if the stimulus was a little darker. You can get a sense of that by looking at the blue curve which averages 312/467 = 2/3 of a stop down from the green, and the red curve, which averages 183/457 = 1 1/3 stop down from the green. Not as far down as you wanted to go, but it's some more information.

Good idea.

Quote
Also by the way, I believe the reason the ISO 6400 points jump up like they do is because there is some noise reduction that the camera does at that ISO that you can't turn off.

I agree.

Jack

PS Jim, could you post somewhere the NEF with the 1-2 electron image?  I'd be interested to play with it a bit if at all possible.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 03:11:57 pm
Jim, could you post somewhere the NEF with the 1-2 electron image?  I'd be interested to play with it a bit if at all possible.

Sure, Jack.

ISO 640. (http://www.kasson.com/ll/_D429478.NEF)

ISO 100. (http://www.kasson.com/ll/_D429481.NEF)

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 30, 2013, 03:13:59 pm
Yes, but with an arrangement that's more useful for the topic at hand, and with a few additional pieces of information. 

Indeed.

Quote
Nevertheless, it's probably more important to know the real optimal Photon noise versus camera noise trade-off point, as far as it's controlled by the ISO setting, although it may be different at various level of exposure.

You mean in case of non-linearities?  What could those be in a practical situation?

Quote
However, do note that the overall noise level at a certain ISO setting may be objectionable from an aesthetical point of view, even though the objective SNR is optimal. It's still a trade-off, and collecting more photons will always give better quality.

Noted.  As far as I am concerned the exercise is really useful to determine ISO for maximum information (IQ) captured, assuming a maxed-out, fixed exposure.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 03:54:11 pm
Yes, the RX-1 does appear to have a read noise sweetspot around ISO 800, and I calculate its Unity-Gain at around that based on a 13 bit ADC.

Jack, at the light levels that I'm using, the read noise is a very small contributor to the total noise, especially since, being uncorrelated with the shot noise and PRNU, it adds as the square root of the sum of the squares. That calculation renders relatively small numbers inconsequential. Two noise sources a factor of ten apart product a result that’s 0.5% more than the larger one.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 04:37:52 pm
Something seems wrong here: the M9 sensor should have roughly the same 60,000 electron full well capacity as other Kodak full frame type sensors with 6.8 micron pixels, like the KAF-31600: http://www.truesenseimaging.com/all/download/file?fid=11.62
so that 30,000 seems too low. Also, the other numbers seem too high, and it would be puzzling for full frame type CCDs to have lower rather that higher full well capacity, since the main virtue of full frame type sensors is using almost all of the sensor area for storing photo-electrons, whereas CMOS sensor use some space for the three or more processing transistors per photo-site.

Sorry it's taken me so long to research this. I can't find anything wrong with my numbers. I did look at Sensorgen (http://www.sensorgen.info/).  They put the M9 FWC at 30976 while I put it at 28670. I don't think that's so far off. They say the D4 FWC is 117813 and I say it's 111404. Again, considering the crudeness of my testing, I don't think that's way off. I've got the D800E at 47510 and they've got it at 44972. If I'm way off, so are they. Anybody want to comment on their methods or accuracy?

BTW, both Sensorgen and I are guilty of using more decimal places for these electron counts than can possibly be significant. My high school Physics teacher would be all over me. Mea culpa. I have no defense, other than it's fun to think in terms of individual electrons.

Also, sensors like these with microlenses are known to hav quantum efficiency of around 40% or better with color filter arrays and higher without: about 80%. That is, about 2.5 photons per photo-electron with CFA, under 2 photons/electron without. So 6.2 photons per photo-electron is way to high.

Also, understand that it is not a matter of the sensor counting up to some number of photons and then scoring one electron; it is instead a probabilistic thing. For example, when a sensor has 80% quantum efficiency with no CFA in place, it means that each photon has an 80% chance of causing an electron to be deposited in the well, a 20% chance of going undetected.

My methods don't worry about how many photons it takes to get an electron, although I'm open to extending the procedure (and my camera modeling)  to that.

Thanks,

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 30, 2013, 07:08:42 pm
Also, sensors like these with microlenses are known to hav quantum efficiency of around 40% or better with color filter arrays and higher without: about 80%. That is, about 2.5 photons per photo-electron with CFA, under 2 photons/electron without. So 6.2 photons per photo-electron is way to high.

I had missed this originally, BJL.  I think that you are correct in general, but perhaps a little exploration of the subject would be useful.  What we typically refer to as QE in photography, often specifying it as a single percentage, is better referred to as Effective Absolute Quantum Efficiency (or AQE).  Absolute Quantum Efficiency is in fact a function made up of the product of three major components: transmittance (T) of light above a detector (CFA and other filters), the effective Fill Factor (FF), and the Charge Collection Efficiency (n, or simply QE) of the photodiode/detector/site.

 T and n are wavelength dependent, so AQE is too.  T is wavelength dependent in part because we only want one of three RGB color ranges to make it through to the photosite, so we design color filter arrays with the appropriate wavelength-dependent filtering action.

Charge Collection Efficiency (n) is wavelength dependent because a photon carries a wavelength-dependent amount of energy.  More energy, more electrons according to the Responsivity of the photodetector: the vertical axis in the following image represents the number of electrons generated at a given exposure for a silicon photodiode without filters, the horizontal axis is the wavelength of the incoming light:

(http://www.thorlabs.com/images/TabImages/FSD100_FSD1010_large.jpg)

Note how in this case light of wavelength 550nm generates more than twice the electrons (current) than light at 400nm.  If this is incorrect, I would be grateful if someone could explain why.

If we put together T, FF and n we get Absolute Quantum Efficiency like so:

 (http://www.qsimaging.com/images/photos/KAF-8300-color-QE.jpg)

So for instance if we were to illuminate that sensor behind an IR filter with light of D50 spectrum, I understand that a photosite would only get the integral of the respective R, G or B curve under which it is sitting - or about 13% of the total number of arriving photons.  Current sensors are only slightly better.  The D800e for instance averages out at an Effective Absolute Quantum Efficiency of just shy of 16% - requiring 6+ photons to hit the sensor before the energy necessary to release one electron is achieved.  You can read the Effective AQE of the RX-1 in the table that I posted earlier in this page.

Quote
P. S. the name "unity gain" is a bit unfortunate, as it perpetuates the myth that there is "no amplification" at some natural exposure index level, and "amplification" at all higher EI settings. Instead with various dimensional conversions from photo-electron counts (charges) to currents to voltages to numerical ADC levels, the idea of "unamplified" or "gain of one" is physically meaningless. I suppose the idea of "one ADC level per detected photon" can be useful, as an upper limit on the level of amplification that can help with image quality, SNR and such.

I would tend to agree, but I am intrigued by the possibilities none the less :)

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 30, 2013, 11:03:06 pm

Note how in this case light of wavelength 550nm generates more than twice the electrons (current) than light at 400nm.  If this is incorrect, I would be grateful if someone could explain why.

Jack

It's almost correct except for the units, Jack. An electron has units of charge (well, energy really). Current has units of charge per unit time.

Quote
The D800e for instance averages out at an Effective Absolute Quantum Efficiency of just shy of 16% - requiring 6+ photons to hit the sensor before the energy necessary to release one electron is achieved.

Are we really sure that, for a given QE, there is some threshold value of photon count below which free electrons can not be produced?

I would have thought the QE factor would be applicable to any number of photons such that there is probability that even one photon could produce an output. By this I mean that, for many succeeding tries (say 100 tries with a QE of 16%) one electron would be produced in 16% of those tries (at some confidence level, depending on the number of tries). Putting that another way, if 1 photon arrives at the D800e sensor, the probability of it producing an electron is 0.16 (16%).

Would be interested to know the difference between "Effective Absolute Quantum Efficiency" and "Absolute Quantum Efficiency"?
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 30, 2013, 11:34:54 pm
It's almost correct except for the units, Jack. An electron has units of charge (well, energy really). Current has units of charge per unit time.

Ted, I'm not sure that the camera engineers look at it this way, but we can get the dimensions correct if we think of the electrons forming in the well over a period of time as a kind of current, although it's not flowing past a point. If we have a 100,000 electrons FWC, and the well gets 62,400 electrons during a 1/100 second exposure, that's one picoamp.

We can get a kind of quantum efficiency if we divide photographic current (a word I just made up), measured in electrons/sec, by photon flux, measured in photons/sec. If the denominator is the same in both, it's the same number as just dividing photons by electrons.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 31, 2013, 12:09:02 am
Ted, I'm not sure that the camera engineers look at it this way, but we can get the dimensions correct if we think of the electrons forming in the well over a period of time as a kind of current, although it's not flowing past a point. If we have a 100,000 electrons FWC, and the well gets 62,400 electrons during a 1/100 second exposure, that's one picoamp.

Jim

Hello Jim,

The literature poses the whole concept of using photodiodes in a camera sensor as based on charge collection, as opposed to their use in solar panels where current is the prime consideration - hence Jack's graph units of A/W where W is a radiometric measurement as opposed to photometric.

It is not correct to assign 1 pA to the well example above. Yes, it can argued of course that 1 pA is the average current that would flow in order to charge the capacitance by some value, but the true capacitor charge is a simple count of electrons collected during the exposure period (ignoring leakage, etc). The example value of 1 pA becomes invalid if, for example during an exposure in low light of some seconds, there were some flashes of lightning!
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 31, 2013, 12:15:01 am
It is not correct to assign 1 pA to the well example above. Yes, it can argued of course that 1 pA is the average current that would flow in order to charge the capacitance by some value, but the true capacitor charge is a simple count of electrons collected during the exposure period (ignoring leakage, etc). The example value of 1 pA becomes invalid if, for example during an exposure in low light of some seconds, there were some flashes of lightning!

Ted,

Well, it was a thought. If current is not a useful concept in photography, why all the talk about "dark current"?

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 31, 2013, 12:26:07 am
Ted,

Well, it was a thought. If current is not a useful concept in photography, why all the talk about "dark current"?

Jim

Yes, dark current is camera-ese for what is more generally know as the leakage current of a reverse-biased diode, photo-sensitive or not. It is a function of the reverse voltage and absolute temperature of the junction. In other words, "dark current" is not restricted to camera sensors; the big fat diodes in your car alternator have it too ;)

In many ways, the passage of electrons can be regarded as "current" with the complication that current has time-1 in it's units. The analogy in mechanical engineering is the difference between "work done" (lbf-ft, Joules) and power (HP, Watts).

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 31, 2013, 05:29:01 am
In many ways, the passage of electrons can be regarded as "current" with the complication that current has time-1 in it's units. The analogy in mechanical engineering is the difference between "work done" (lbf-ft, Joules) and power (HP, Watts).

Hi Ted,

Jim did a good job of outlining the way I've seen it in the literature (http://www.amazon.com/Sensors-Processing-Digital-Cameras-Engineering/dp/0849335450/ref=sr_1_1?s=books&ie=UTF8&qid=1364720821&sr=1-1), even for camera sensors.  The confusion arises when we mix radiometric (flux, power etc.) and photometric quantities (Illuminance, exposure etc.) (http://en.wikipedia.org/wiki/Exposure_(photography)).  The units are different but they describe exactly the same physical processes.  For instance I find it useful to think of Exposure as a certain number of photons incident on an area during exposure time.  But to calculate that number one has to do a few backward somersaults with both sets of units (maybe worth a separate thread).

Illuminance (in lux) provides a certain number of photons per second which get converted into e-/second by the photodiode.  So while a photographic sensor is exposed to a certain illuminance, a current of e-/s is indeed generated within the integrating photodiode, which holds the resulting total charge so that it can be read by the downstream circuitry.  The responsivity diagrams of a solar vs a photographic photodiode look very similar.  What changes are the slopes, which are related to the material used and charge collection efficiency.

(http://www.fiberoptics4sale.com/wordpress/wp-content/uploads/2011/02/Spectral-dependence-of-responsivity-and-quantum-efficiency.gif)

Jack

PS Happy Easter
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on March 31, 2013, 11:54:04 am
Are we really sure that, for a given QE, there is some threshold value of photon count below which free electrons can not be produced?

I would have thought the QE factor would be applicable to any number of photons such that there is probability that even one photon could produce an output. By this I mean that, for many succeeding tries (say 100 tries with a QE of 16%) one electron would be produced in 16% of those tries (at some confidence level, depending on the number of tries). Putting that another way, if 1 photon arrives at the D800e sensor, the probability of it producing an electron is 0.16 (16%).

I don't know the exact process by which a color filter filters photons, so you may well be right.  Does anybody know?

Quote
Would be interested to know the difference between "Effective Absolute Quantum Efficiency" and "Absolute Quantum Efficiency"?

Absolute Quantum Efficiency is the term used in the industry by vendors like Kodak to describe the combined effect of transmittance, fill factor and charge conversion efficiency at various signal wavelengths for a particular photographic sensor.  So say your chosen exposure results in 100k photons of daylight reflected from a neutral object hitting, say, a green sensel of your camera's sensor.  How many electrons can you expect in the well?

Recall that the green curve in the Absolute QE chart of the previous post has a peak of 40%.  But not all photons are of that wavelength.  Since we know that daylight has a spectral power distribution more or less like this

(http://upload.wikimedia.org/wikipedia/commons/4/4c/Solar_Spectrum.png)

we simply integrate the product of the curve above with the green sensel curve in the Absolute QE graph of the earlier post.  The answer is around 13%, so one would expect about 13k electrons to be fed to the ADC for that exposure.  What about the neighbouring blue and red sensels?  Slightly different numbers.  The (weighted?) average of the three is what I call Effective Absolute QE, a single number that gives a relative indication of the efficiency of a sensor in converting photons to electrons.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on March 31, 2013, 12:20:33 pm
Hi Ted,

Jim did a good job of outlining the way I've seen it in the literature (http://www.amazon.com/Sensors-Processing-Digital-Cameras-Engineering/dp/0849335450/ref=sr_1_1?s=books&ie=UTF8&qid=1364720821&sr=1-1), even for camera sensors.  The confusion arises when we mix radiometric (flux, power etc.) and photometric quantities (Illuminance, exposure etc.) (http://en.wikipedia.org/wiki/Exposure_(photography)).  The units are different but they describe exactly the same physical processes.  For instance I find it useful to think of Exposure as a certain number of photons incident on an area during exposure time.  But to calculate that number one has to do a few backward somersaults with both sets of units (maybe worth a separate thread).

Illuminance (in lux) provides a certain number of photons per second which get converted into e-/second by the photodiode.  So while a photographic sensor is exposed to a certain illuminance, a current of e-/s is indeed generated within the integrating photodiode, which holds the resulting total charge so that it can be read by the downstream circuitry.  The responsivity diagrams of a solar vs a photographic photodiode look very similar.  What changes are the slopes, which are related to the material used and charge collection efficiency.

(http://www.fiberoptics4sale.com/wordpress/wp-content/uploads/2011/02/Spectral-dependence-of-responsivity-and-quantum-efficiency.gif)

Jack

PS Happy Easter

Hello Jack,

Thank you for your lucid explanation, the link to Wikipedias "all about exposure", and the illuminating graph.

Happy Easter 2U2.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 31, 2013, 01:51:31 pm
I've been trying to get at the visual effect of turning down the ISO below the unity gain ISO. I created a simulated Nikon D4 with some unusual characteristics: zero read noise and perfect pixel response uniformity. While I was at, it, I gave it a Fovean-like characteristic of having all four planes (two green ones) stacked on top of eash other, so there's no demosaicing. That's not important now, but it will be if and when I start feeding this simulation some images. Actually, it is somewhat important; it means that there are no values between integer electron counts generated by interpolation.

I excited a 350x350 pixel portion of the sensor with enough D65 photons to average 100 electrons per photosite in the green channels, using the real D4 ratios of red to green and blue to green raw values when faced with a D65-lit gray card.

I made simulated exposures at ISO 640, 320, 160, 80, and 40. Unlike the real D4, the simulated version has enough gain range to make the ISO 80 and 40 settings meaningful.

While still in linear camera space, I multiplied each pixel in each image by 1 for ISO 640, 2 for ISO 320, 4 for ISO 160, and so on, giving me very close to equal average values. Then I multiplied the values in each image by 100, to make the numbers big enough so that I wouldn't need heroic measures in Photoshop. The actual mean and standard deviation of the images when normalized to the range [0,1] is given in the following table:

(http://www.kasson.com/ll/PerfectD4ISOSimulation.PNG)

Bart, this is what I mean about the standard deviation of the photon noise being robust in the face of resolution. The ISO 640 image can resolve every electron, while the ISO 40 image has counts from 0 to 15 with the same ADC value.

I brought the images into Photoshop as Adobe RGB with a identity conversion matrix (diagonal ones, else zeros), gave them a bit over 1 EV exposure bump, and (over) corrected the greenish color cast. Here's the histogram of the ISO 640 image:

(http://www.kasson.com/ll/PerfectD4ISOSimulation640histo.PNG)

Here's the histogram of the ISO 40 image:

(http://www.kasson.com/ll/PerfectD4ISOSimulation80histo.PNG)

Note the extreme depopulation.

Here's the ISO 640 image, magnified to 700x700 with nearest neighbor to resist JPEG degradation:

(http://www.kasson.com/ll/UGNoiseTest100electrons640.jpg)

Here's the ISO 320 image:

(http://www.kasson.com/ll/UGNoiseTest100electrons320.jpg)

Here's the ISO 160 image:

(http://www.kasson.com/ll/UGNoiseTest100electrons160.jpg)

Here's the ISO 80 image:

(http://www.kasson.com/ll/UGNoiseTest100electrons80.jpg)

Here's the ISO 40 image:

(http://www.kasson.com/ll/UGNoiseTest100electrons40.jpg)


The low ISO images are somewhat clumpier than the Unity Gain ISO one, but the effect is subtle, even though the histograms look dramatically different. This test bends over backwards to give the Unity Gain ISO image a chance to shine, and to me, it's barely glowing. I am coming around to the school of thought that what's really important for ordinary photographers is the SNR, although I can understand the appeal of UGiso if you're going to be doing computations or mathematical processing on your images.

Jim

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 31, 2013, 03:48:22 pm
Here's a link to a .psd file with a layer for each of the 350x350 images in the preceding post, an exposure layer, and a color balance layer with better settings than that used for the preceding post.

http://www.kasson.com/ll/UGNoiseTest100electrons.psd (http://www.kasson.com/ll/UGNoiseTest100electrons.psd)

I recommend that you load the image into Photoshop, and look at the differences between the layers by turning them on and off while leaving the top two adjustment layers in place. Feel free to change the color balance settings.

Enjoy...

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 31, 2013, 04:33:47 pm
Bart, Ted, Jack (and anybody else who cares),

So far, I've been modeling pixel response non-linearity (PRNU) as if each cell had a slightly different quantum efficiency: ie the calculation has been done before the signal in each photosite was quantized into discrete electrons. FWIW, I've been using a probablistic model of converting photons to electrons, not a film-like threshold model; I don't really know if this is right or not.

But this is a post about PRNU. It occurs to me that there's another explanation for it, and if that explanation explains most of it, then PRNU should be considered after the electrons in the well are converted from probabilities to actual electron counts. I don't know a lot about how these imaging chips work, but here's the model I have in my brain. The photodiode converts photons to electrons, the electrons charge a capacitor, the voltage on that cap is buffered by an amp in the cell, and eventually the voltage gets amplified and converted to digital.

If I've got that right, a potential source of PRNU is variation in the sensel capacitance. The voltage, V, on a capacitor as a function of the charge, Q, and capacitance, C, is V = Q/C. You can see that, with the charge held constant, changes in C will cause changes in V, and there's no reason I know of to suspect that the changes in C occur in quanta. The same is true of amplifier gain variation, in both the ISO-programmable amplifiers and the source followers, of which there is presumably one per sensel.

Anybody have an ideas on what the underlying sources of PRNU are?

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on March 31, 2013, 11:14:00 pm
One more set of simulation images. The camera this time is a D4 with read noise and PRNU (before electron quantizing). Same test pattern as the real D4 image before. One electron in each of the green planes for the bright parts, less for the red and blue planes. D65 illuminant. Raw image multiplied by 1000 when still in raw space with linear gamma. Small exposure correction -- about +1EV -- in Photoshop after conversion to Adobe RGB.  No black point corrections.

ISO 640 image:

(http://www.kasson.com/ll/UGImageNoiseTestISO640.jpg)

ISO 320 image x2 in linear raw:

(http://www.kasson.com/ll/UGImageNoiseTestISO320.jpg)

ISO 160 image x4 in linear raw:

(http://www.kasson.com/ll/UGImageNoiseTestISO160.jpg)

Pretty close to the real thing. I'd give the nod to the Unity Gain ISO image at ISO 640, but it's not head and shoulders above the others.

If you want to see the parameters of the D4 simulation, here's the code for the camera constructor. It's in Matlab, but the code should look pretty familiar to any C++ or Java programmer.

(http://www.kasson.com/ll/MatlabD4code.PNG)

I suppose that I could do another set of simulations with probabilistic electrons coming from a known photon flux, but I get the feeling that I'm beginning to overdo this.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on April 01, 2013, 12:59:51 am
Bart, Ted, Jack (and anybody else who cares),

But this is a post about PRNU. It occurs to me that there's another explanation for it, and if that explanation explains most of it, then PRNU should be considered after the electrons in the well are converted from probabilities to actual electron counts. I don't know a lot about how these imaging chips work, but here's the model I have in my brain. The photodiode converts photons to electrons, the electrons charge a capacitor, the voltage on that cap is buffered by an amp in the cell, and eventually the voltage gets amplified and converted to digital.

If I've got that right, a potential source of PRNU is variation in the sensel capacitance. The voltage, V, on a capacitor as a function of the charge, Q, and capacitance, C, is V = Q/C. You can see that, with the charge held constant, changes in C will cause changes in V, and there's no reason I know of to suspect that the changes in C occur in quanta. The same is true of amplifier gain variation, in both the ISO-programmable amplifiers and the source followers, of which there is presumably one per sensel.

Anybody have an ideas on what the underlying sources of PRNU are?

My 2e's worth:

Non-unformity between pixels is no different to any other mass-produced item and no production process is perfect. There are many things that cause variance in pixel characteristics especially if filters and microlenses are included. All variances are significant, including those of the semiconductor doping and lithographic processes, thickness of the materials, the depletion layer, fill, metalization accuracy, CFA consistency, microlens MTF, the list is almost endless . . .

Therefore, it would be better perhaps to not assign any one factor such as photodiode capacitance (it's not a separate capacitor) as a probable cause - so maybe a constant variance in overall QE between pixels would do it for your purposes? I say "constant" to avoid confusion with the variation of QE with wavelength, photon quantity or rate, or the direction of the wind. I am using "variance" in the statistical sense and "constant" in the sense that any given pixel has a constant % difference to any other given pixel on average over thousands of exposures.

In a previous life, I was concerned about resistor values, amongst other things. A 100K resistor born as a 102.3K resistor was OK, so long as it stayed that way during the life of my equipment. Another 100K of a different value say 99.8K in the same op-amp circuit was equally acceptable. So long as they didn't change much during aging. All of which is why God invented trim-pots ;)
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 01, 2013, 05:52:09 am
The low ISO images are somewhat clumpier than the Unity Gain ISO one, but the effect is subtle, even though the histograms look dramatically different. This test bends over backwards to give the Unity Gain ISO image a chance to shine, and to me, it's barely glowing. I am coming around to the school of thought that what's really important for ordinary photographers is the SNR, although I can understand the appeal of UGiso if you're going to be doing computations or mathematical processing on your images.

Jim, I don't know what to say.  In this and your next simulation you have modelled the two competing effects (SNR and UG) beautifully.  If I understand correctly in the first simulation we are looking at a uniform patch about 10.2 stops below clipping, with dithering provided by photon/shot noise only.  To simulate viewing a perfect 8x12" print of them at arm's length I can suggest zooming the patches on screen so that they are about 2.5" (65mm = 2x500xtan0.01x350) on each side.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 01, 2013, 06:31:21 am
One more set of simulation images. The camera this time is a D4 with read noise and PRNU (before electron quantizing). ...

Pretty close to the real thing. I'd give the nod to the Unity Gain ISO image at ISO 640, but it's not head and shoulders above the others.

I agree that the ISO 640 image is preferable, as it would be in real life also because read noise for the D4 decreases rapidly from ISO 100 (18.6e-) to ISO 800 (3.4e-).  I believe that read noise of 18.6e- (4+ ADUs) at ISO 100 would visually swamp any quantization effects.  Did you model this change or was read noise kept constant?

Quote
If you want to see the parameters of the D4 simulation, here's the code for the camera constructor. It's in Matlab, but the code should look pretty familiar to any C++ or Java programmer.

The question that comes to mind is whether you used QE of 53% for your broad spectrum illuminant.  I understand that the Sensorgen value assumes a green laser as the illuminant :)

Quote
I suppose that I could do another set of simulations with probabilistic electrons coming from a known photon flux, but I get the feeling that I'm beginning to overdo this.

Jim

Another improvement to the model, if you haven't done so already, is to separate the read noise into two components: a sensor component and an analog  'gain' component.  They are apparently not correlated.  Here is a thread by Dosdan (http://www.dpreview.com/forums/thread/3453568) on the subject.  The reason for doing so is that, from a noise perspective, the performance of a particular sensor can intuitively be understood as, aotbe, the DR of the incoming light, having to pass through the DR of the sensor, having to pass through the DR of the analog amplification chain as a function of the gain (ISO) applied.

Fabulous work, Jim, as visually relevant as any that I've seen on this subject. 

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 01, 2013, 06:32:36 am
My 2e's worth:

Good description, Ted.  I wouldn't know what to add, Jim.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: bjanes on April 01, 2013, 06:39:40 am

I brought the images into Photoshop as Adobe RGB with a identity conversion matrix (diagonal ones, else zeros), gave them a bit over 1 EV exposure bump, and (over) corrected the greenish color cast. Here's the histogram of the ISO 640 image:

(http://www.kasson.com/ll/PerfectD4ISOSimulation640histo.PNG)

Here's the histogram of the ISO 40 image:

(http://www.kasson.com/ll/PerfectD4ISOSimulation80histo.PNG)

Note the extreme depopulation.


Jim,

Nice work as usual, but the histogram of the bottom image needs to be refreshed as indicated by the little triangle with the exclamation Repoint. See the Adobe help (http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-768da.html#WSfd1234e1c4b69f30ea53e41001031ab64-7684a) for details.

Regards,

Bill

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 01, 2013, 07:08:21 pm
I agree that the ISO 640 image is preferable, as it would be in real life also because read noise for the D4 decreases rapidly from ISO 100 (18.6e-) to ISO 800 (3.4e-).  I believe that read noise of 18.6e- (4+ ADUs) at ISO 100 would visually swamp any quantization effects.  Did you model this change or was read noise kept constant?

I kept read noise constant referred to amplifier input. I understand that putting read noise on both sides of he amplifier makes theoretical, sense, and fits some data well. I'm having trouble getting it to fit all my camera data. Here's a look at the D4 read noise as I've measured it, plotting both mean and mean plus standard deviation:

(http://www.kasson.com/ll/D4ReadNoisevsISO.PNG)

That looks like it would be pretty easy to fit the two-stage read noise model to. But now look at the RX-1:

(http://www.kasson.com/ll/RX1ReadNoisevsISO.PNG)

There are two big problems here. The first is that, with the exception of the ISO 100 point, the read noise component on the output side of the amplifier is darned close to zero. The second is that the read noise goes down as the ISO is increased from 100 to 200. With the two-stage model, that shouldn't happen.

The M9 noise can't be modeled with the two-stage model (I've left off the standard deviation line):

(http://www.kasson.com/ll/M9ReadNoisevsISO.PNG)

The model looks like it could work for the D800E:

(http://www.kasson.com/ll/D800EReadNoisevsISO.PNG)

and the NEX-7:

(http://www.kasson.com/ll/NEX7ReadNoisevsISO.PNG)

I'm scratching my head right now. I'm also having trouble figuring out how to estimate the standard deviations of the portion of the read noise referred to the output of the amplifier in the cases where the base gain is only a stop or two away from unity gain.

Jim


Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 01, 2013, 07:11:20 pm
The question that comes to mind is whether you used QE of 53% for your broad spectrum illuminant.  I understand that the Sensorgen value assumes a green laser as the illuminant :)

Jack, right now I'm just working with electrons, so the QE number isn't used.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 01, 2013, 07:13:55 pm
Another improvement to the model, if you haven't done so already, is to separate the read noise into two components: a sensor component and an analog  'gain' component.  They are apparently not correlated.  Here is a thread by Dosdan (http://www.dpreview.com/forums/thread/3453568) on the subject.  The reason for doing so is that, from a noise perspective, the performance of a particular sensor can intuitively be understood as, aotbe, the DR of the incoming light, having to pass through the DR of the sensor, having to pass through the DR of the analog amplification chain as a function of the gain (ISO) applied.

Thanks for the link, Jack. Emil Martinec says pretty much the same thing, but, as I posted above, I'm having trouble fitting the model to two cameras.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 01, 2013, 07:17:32 pm
Non-unformity between pixels is no different to any other mass-produced item and no production process is perfect. There are many things that cause variance in pixel characteristics especially if filters and microlenses are included. All variances are significant, including those of the semiconductor doping and lithographic processes, thickness of the materials, the depletion layer, fill, metalization accuracy, CFA consistency, microlens MTF, the list is almost endless . . .

Yep, so it is. I'm just trying to figure out whether most of the PRNU occurs before quantizing to electrons or afterward. If the weight of the two components is similar, then I'll never get data to put into a two-stage model.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 01, 2013, 07:25:59 pm
...the histogram of the bottom image needs to be refreshed as indicated by the little triangle with the exclamation Repoint. See the Adobe help (http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-768da.html#WSfd1234e1c4b69f30ea53e41001031ab64-7684a) for details.

Bill,

You're right. Here are the two (refreshed) histograms for the images in the psd file pointed to a few posts above.

ISO 640:

(http://www.kasson.com/ll/PSUG100ElectronsISO640.PNG)

ISO 40:

(http://www.kasson.com/ll/PSUG100ElectronsISO40.PNG)

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on April 02, 2013, 02:02:06 am
[the list is almost endless . .] Yep, so it is. I'm just trying to figure out whether most of the PRNU occurs before quantizing to electrons or afterward. If the weight of the two components is similar, then I'll never get data to put into a two-stage model.

As one who has only just figured out the basic reason why the shot noise variance (at the ADC output) for low ISO's is less than the mean, my input may not count for much . .

Mostly, the literature states that PRNU applies to the sensor pixel output and, importantly, is often called "fixed pattern" unfortunately followed by the word "noise" (classic photographic obfuscation?). There I go, drifting off again  .  .  .

So, perhaps you could assign an rms value to define permanent pixel-to-pixel variations, in the same way that lens quality can be defined or indeed the roughness of machined surfaces?

A kindred spirit here? http://harvestimaging.com/blog/?p=916

This from a Paper for the Foveon F7 sensor may be of interest:

Quote
Well capacity is approximately 77,000 electrons per photodiode but the usual operating point (for restricted nonlinearity)
corresponds to about 45,000 electrons. Photo response non-uniformity (PRNU) is less than ±1%.
Several fixed-pattern and random noise reduction techniques have been incorporated into the F7 design to realize very
good noise performance for the CMOS technology. The total fixed pattern noise from all sources is less than ±1%. The
primary contributor to dark noise is ktC noise from diode reset. This noise is approximately 70 electrons. It is possible
to reduce this to about 40 electrons by implementing a reset-read-expose-read cycle for the frame and then subtract the
first frame from the second.

OT - have you tried ImageJ yet?

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Bart_van_der_Wolf on April 02, 2013, 04:54:59 am
OT - have you tried ImageJ yet?

Hi Ted, and others,

On that note, I've made an improved ImageJ macro available for download (https://dl.dropboxusercontent.com/u/3179763/SplitBayerCFA.ijm) (save with right mouse button click) which will split a Bayer CFA image into its individual R/G1/G2/B channels. The macro can be copied into the 'ImageJ\plugins\Macros' folder, and will show up in the 'Plugins/Macros' pull-down menu at the bottom menu section between the other plugins that you may have installed.

As input it takes the currently active (cropped) image (presumably a 16-bit linear gamma, non-demosaiced Bayer CFA image), and it allows to choose one from four common CFA layouts*. It then produces the separate channels, selectable, and optionally also can generate a file that is the result of subtracting the G1 and G2 channels.

The subtracted G1-G2 result is interesting, because it can be used for an improved noise estimate where the impact of various systematic errors (e.g. sensor dust and non-uniform lighting) is reduced in the total standard deviation. Sometimes all we have is a single file for analysis, in which case it helps to reduce unwanted pollution of the noise data. All that is left is Random noise, calibration errors, and PRNU, assuming we're analyzing a uniformly lit surface. It is also very useful for detecting individual outlier pixels, so we can avoid them being part of our crop to be analyzed by selecting a different crop. It is also interesting to compare this subtracted G1-G2 result with a proper two exposure subtraction, which is the preferred way to conduct random noise analysis.

There is also an ImageJ DCRaw plugin (http://ij-plugins.sourceforge.net/plugins/dcraw/index.html) available to acquire the Raw non-demosaiced source data (DCRaw Document mode) directly from the Raw camera file.  After installation the IJ-DCRaw plugin is available under the 'Plugins/Image IO' menu.

Cheers,
Bart

* Which CFA pattern layout to choose, depends on a number of things. One is the Camera model, another is whether the masked pixels are included or excluded in the Raw image data. Also important is that image crops are made at the 'correct' pixel offset position, and that image rotation is kept constant. I have yet to find an easy way of automatically determining that pattern, other than using a reference image with clear Red, Green, and Blue, features. The lightest channel corresponds to that color. For many cameras, the two Green Channel files should have very similar mean brightness values, resulting in an almost zero mean value for the G1-G2 subtracted result.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 02, 2013, 10:45:55 am
I built a two-stage read noise model for the D4. Here's a plot of the mean and mean+standard deviation for the measured and the modeled values:

(http://www.kasson.com/ll/D4readnoisevsModel.PNG)

The values are:

(http://www.kasson.com/ll/D4readnoisevsModelValues.PNG)

That's more noise at the lower ISOs than I'm seeing on the real camera. Some possibilities are: a) one-electron test shots were made at 1/8000 sec exposure, where read noise test shots were made at 1/30, b) there's some ACR processing going on that's making a difference, c) there were some artifacts in the read noise test shots like the read smear in the ISO 640 one-electron shot.

I've got some research to do.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: xpatUSA on April 02, 2013, 12:15:13 pm
Hi Ted, and others,

On that note, I've made an improved ImageJ macro available for download (http://bvdwolf.home.xs4all.nl/main/downloads/SplitBayerCFA.ijm) (save with right mouse button click) which will split a Bayer CFA image into its individual R/G1/G2/B channels.
Thanks for the post Bart,

Sorry to tell you that my only serious camera is a Foveon-based SD10 housebrick but your macro would be quite use for others for sure. My other camera, a micro four thirds, is used as a point-and-shoot and I take the JPEGs as they come.

That dcraw plug-in is certainly of interest, I'm currently doing it the hard way but which is the most flexible way.



Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 02, 2013, 12:31:56 pm
That looks like it would be pretty easy to fit the two-stage read noise model to. But now look at the RX-1:

There are two big problems here. The first is that, with the exception of the ISO 100 point, the read noise component on the output side of the amplifier is darned close to zero. The second is that the read noise goes down as the ISO is increased from 100 to 200. With the two-stage model, that shouldn't happen.

Yeah, funny that, as if it were getting less light.

Quote
I'm scratching my head right now. I'm also having trouble figuring out how to estimate the standard deviations of the portion of the read noise referred to the output of the amplifier in the cases where the base gain is only a stop or two away from unity gain.

Well, if you have been buying my dithering snake oil you could just pretend that you have a large enough sample...
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 02, 2013, 12:52:14 pm
I built a two-stage read noise model for the D4. Here's a plot of the mean and mean+standard deviation for the measured and the modeled values:

You are on a roll, Jim!  I assume that you used Poisson distribution for photoelectrons from the sensors in quadrature with a gaussian read noise for the pre/sensor, followed in quadrature again by gaussian read noise in the analog amplifier, followed by an ideal noiseless  ADC?

Quote
(http://www.kasson.com/ll/D4readnoisevsModel.PNG)

That's more noise at the lower ISOs than I'm seeing on the real camera. Some possibilities are: a) one-electron test shots were made at 1/8000 sec exposure, where read noise test shots were made at 1/30, b) there's some ACR processing going on that's making a difference, c) there were some artifacts in the read noise test shots like the read smear in the ISO 640 one-electron shot.

The vertical axis is ADUs, correct?  That's pretty good agreement on the mean, as we would expect. Where does ACR come into the picture?  If you are using it, it could well be the culprit as it's well known that it messes arbitrarily with curves at various ISOs.  Or perhaps the relative read noises are incorrect.  How did you calculate them?

I think I can see in the real camera M+S data the two slopes: the amplifier limited one at low ISOs and that of the amplified sensor once it becomes dominant at 800 and above.  I don't see the same knee in the modelled curve.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 02, 2013, 02:19:24 pm
I assume that you used Poisson distribution for photoelectrons from the sensors in quadrature with a gaussian read noise for the pre/sensor, followed in quadrature again by gaussian read noise in the analog amplifier, followed by an ideal noiseless  ADC?

When you're simulating on a per-pixel level, this quadrature stuff doesn't apply. I take the signal, multiply that by the PRNU image (with the sensitivity of each sensel, populated by a Gaussian distribution centered on one), use Poisson for the shot noise to form an image and add that in, quantize to integer electrons, add the preamp read noise image (generated with Gaussian statistics), multiply by the gain, add the postamp read noise image, and quantize to the number of bits in a perfect ADC.

I'm considering splitting the PRNU multiply into two components, one pre quantizing to electrons, and one post quantizing to electrons. I'm not sure if the shot noise belongs before or after the pre-quantizing PRNU multiplication.

Jim

Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 02, 2013, 02:20:30 pm
Where does ACR come into the picture?

ACR is how I converted the real camera images.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 02, 2013, 02:29:48 pm
The vertical axis is ADUs, correct?  

Yes.

 Or perhaps the relative read noises are incorrect.  How did you calculate them?

I used RawDigger for the real data. The model is totalReadNoise = (postGainNoise^2 + (gain*preGainNoise)^2)^0.5.

I think I can see in the real camera M+S data the two slopes: the amplifier limited one at low ISOs and that of the amplified sensor once it becomes dominant at 800 and above.  I don't see the same knee in the modelled curve.

Here's a log-log version. It's easier to see the low ISO points.

(http://www.kasson.com/ll/D4readnoisevsModelLogLog.PNG)

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 02, 2013, 03:26:38 pm
When you're simulating on a per-pixel level, this quadrature stuff doesn't apply.

Makes sense, of course.

Quote
I take the signal, multiply that by the PRNU image (with the sensitivity of each sensel, populated by a Gaussian distribution centered on one), use Poisson for the shot noise to form an image and add that in, quantize to integer electrons, add the preamp read noise image (generated with Gaussian statistics), multiply by the gain, add the postamp read noise image, and quantize to the number of bits in a perfect ADC.

Is the resulting distribution of the quantized electrons Poisson?  If it's not it could be contributing to differences.

Quote
I'm considering splitting the PRNU multiply into two components, one pre quantizing to electrons, and one post quantizing to electrons. I'm not sure if the shot noise belongs before or after the pre-quantizing PRNU multiplication.

I don't know if it helps, but I find that considering PRNU as random noise that adds in quadrature with shot noise usually works well near saturation for ISO 100-400, max 800.  after that it gets lost in shot noise first and read noise in the upper ISOs later.  I think of PRNU mainly as a fairly complex CFA, as you have done, which varies the luminous flux to each individual photosite - you could say that each site is exposed slightly differently without leaving classical physics.  Each individual photosite then reacts to its own flux quantistically, by generating electrons with probability equal to the charge conversion ratio (aka QE) and Poisson distribution.  So I think of PRNU as before not after quantizing - but it works well even when you add it in quadrature after: go figure.  Unfortunately I am no expert, just happy to be along for the ride :)

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 03, 2013, 05:29:47 am
I'm considering splitting the PRNU multiply into two components, one pre quantizing to electrons, and one post quantizing to electrons. I'm not sure if the shot noise belongs before or after the pre-quantizing PRNU multiplication.

Jim

While thinking about this issue I came across this very interesting thread on the conversion process and noise (http://www.dpreview.com/forums/post/42082844) at DPR.  In a nutshell:

cpw basically says that the photon-electron conversion process starts with a photon stream with a Poisson distribution and results in a smaller electron stream (reduced by QE) also with a Poisson distribution but of different lambda.

joofa:
'Bottom line is that both photon and photoelectron streams are represented by a Poisson process. For our shot noise calculation we shall only consider the photoelectron stream. Hence, there is no issue of an additional noise [due to conversion]'

tlwalton:
'QE is a "bulk property" of the sensor. It's an aggregate of the materials properties and engineering parameters that went into its design and manufacture. Its a consequence, not a mechanism. It could depend, for example, on temperature or wavelength, but all those effects are aggregated into a useful figure of merit, QE, which is assumed for practical reasons not to vary with time.'

bobn2:
'pixel response non-uniformity... is caused by differences between pixels, their gain their capacity and so on. PRNU isn't strictly a 'noise' rather it is a response pattern which differently multiplies the captured samples, thus creating 'noise'. Thus it is proportional to the signal, the number of photons per sample'

Based on these comments, if we consider PRNU as all signal dependent 'noises' proportional to the signal, I think it should make no difference whether it is handled before or after conversion - including CFA non-uniformity - so might as well do everything at the same time.  What do you think?

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 03, 2013, 11:19:15 pm
Based on these comments, if we consider PRNU as all signal dependent 'noises' proportional to the signal, I think it should make no difference whether it is handled before or after conversion - including CFA non-uniformity - so might as well do everything at the same time.  What do you think?

Jack,

If all the PRNU is before quantizing to electrons, as it currently is in the model, then we'll see PRNU jump two counts at a time at twice Unity Gain ISO, and four counts at at time at four times ISOug. There won't be any intermediate values. If it's after quantizing to electrons, then there will be intermediate values, but, of course, none smaller than 1 LSB of the ADC.  So it makes at least a theoretical difference. The power of noise dither being what it is, it probably makes no practical difference.

But when it comes to dither from noise, I'm speaking to the choir, right?

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 03, 2013, 11:38:16 pm
I re-ran the D4 read noise tests, this time at 1/8000 second. I didn't want to do the whole 7x16 exposure series in RawDigger, although it would have been faster if I was only going to do it once, so I learned how to use ImagesPlus, and converted the D4 raw files to flat Tiff's. Then I wrote a Matlab program to load all 112 files and compute the read noise stats for each ISO.

[Non-programmers, avert your eyes] Today I banged my head against the wall trying to figure out why my results were 1/16 of what my spot checks in RawDigger indicated that they should be. After almost two hours of looking for the bug, I found an array assignment statement just below the end of the for loop that it was supposed to be inside of. Some programming languages restrict the scope of loop indices to the loops.  Not Matlab; the index lives on with the last value it had in the loop. Some loosely-typed programming languages will complain if you try to assign a variable to the 16th entry of an undeclared array. Not Matlab; it will happily and silently create the array and make the first 15 entries zero. [end programmer alert]

Here are the new read noise model values:

(http://www.kasson.com/ll/d4rnnew.PNG)

And here's how they look plotted against the new data:

(http://www.kasson.com/ll/D4ReadNoiseModel.PNG)

When fitting the curves, I decided that the ISO 6400 values weren't very important, since, based on what we've learned so far, we'll never use those ISOs.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 04, 2013, 12:08:10 am
The results from the new D4 Simulation with 1 electron stimulus in each green layer at D65 (The post-gain component of the read noise brightens the image as the ISO drops, so I multiplied the images in linear raw space by the square root of two for each step down in ISO, not the full factor of two):

ISO 640:

(http://www.kasson.com/ll/d41eiso640.jpg)

ISO 320:

(http://www.kasson.com/ll/d41eiso320.jpg)

ISO 160:

(http://www.kasson.com/ll/d41eiso160.jpg)

ISO 80:

(http://www.kasson.com/ll/d41eiso80.jpg)

ISO 40:

(http://www.kasson.com/ll/d41eiso40.jpg)

This shows that Unity Gain ISO produced the best results, but the low-ISO images (even the ones that have real-world counterparts) seem a bit too noisy. I think it's clear that in the presence of a post-gain read noise component, that Unity Gain ISO can offer some advantages. Whether they're hugely significant over a ISO's a stop or two lower still needs some investigation.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 04, 2013, 05:08:03 pm
This shows that Unity Gain ISO produced the best results, but the low-ISO images (even the ones that have real-world counterparts) seem a bit too noisy. I think it's clear that in the presence of a post-gain read noise component, that Unity Gain ISO can offer some advantages. Whether they're hugely significant over a ISO's a stop or two lower still needs some investigation.

Jim

Well, I agree that the low ISO images look a bit too noisy.  However Bill Claff's graph (http://home.comcast.net/~NikonD70/Charts/PDR_Shadow.htm#D4) suggests that there should be a difference of 1.5 stops in SNR between ISO 640 and 100 or so - perhaps that's what it looks like.  And the model does fit real data.  Do the related real world test images look similar?

Now that you have the sensor/gain read noise model, I almost feel that a more useful interpretation comes from plotting the two and seeing when one becomes dominat over the other, as Dosdan did in the previously mentioned DPR thread (http://www.dpreview.com/forums/thread/3453568?page=4)

(http://www.dpreview.com/files/t/E~a5b3193a3e204f75b11339b5b3940319)

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 04, 2013, 05:09:28 pm
And here's how they look plotted against the new data:

(http://www.kasson.com/ll/D4ReadNoiseModel.PNG)

When fitting the curves, I decided that the ISO 6400 values weren't very important, since, based on what we've learned so far, we'll never use those ISOs.

Jim

Right, excellent fit.  Great job.
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 04, 2013, 05:10:40 pm
Jack,

If all the PRNU is before quantizing to electrons, as it currently is in the model, then we'll see PRNU jump two counts at a time at twice Unity Gain ISO, and four counts at at time at four times ISOug. There won't be any intermediate values. If it's after quantizing to electrons, then there will be intermediate values, but, of course, none smaller than 1 LSB of the ADC.  So it makes at least a theoretical difference. The power of noise dither being what it is, it probably makes no practical difference.

But when it comes to dither from noise, I'm speaking to the choir, right?

Jim

Gorregt :)
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 04, 2013, 07:01:29 pm
Now that you have the sensor/gain read noise model, I almost feel that a more useful interpretation comes from plotting the two and seeing when one becomes dominat over the other, as Dosdan did in the previously mentioned DPR thread (http://www.dpreview.com/forums/thread/3453568?page=4)

(http://www.dpreview.com/files/t/E~a5b3193a3e204f75b11339b5b3940319)

Jack, here the graph is with the two components added in. I don't think the change adds much, though. You can see the effect of each of the components well enough by looking at the general shape of the previous curve. The two components will alway be straight lines on a log-log graph, and the combined curve will approach each one asymptotically at both ends.

(http://www.kasson.com/ll/D4ReadNoiseModelParts.PNG)

If it helps you, then enjoy.

Jim
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 05, 2013, 06:32:52 am
Here are the new read noise model values:

(http://www.kasson.com/ll/d4rnnew.PNG)

Jim, may I ask how you determine these values?  Find the lowest total read noise at a highish ISO, assume that it is all 'sensor' related, then calculate the amplifier read noise subtracting in quadrature the sensor read noise from total read noise at a lowish ISO?  It's quite sensitive to the chosen lowish ISO.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jack Hogan on April 05, 2013, 06:39:17 am
Jack, here the graph is with the two components added in. I don't think the change adds much, though. You can see the effect of each of the components well enough by looking at the general shape of the previous curve. The two components will alway be straight lines on a log-log graph, and the combined curve will approach each one asymptotically at both ends.

(http://www.kasson.com/ll/D4ReadNoiseModelParts.PNG)

If it helps you, then enjoy.

Jim
Thank you, you are right.  It just makes it a bit easier to see intuitively where increasing ISO no longer has a beneficial effect on noise.

Jack
Title: Re: Computing Unity Gain ISO from a single exposure
Post by: Jim Kasson on April 05, 2013, 12:40:56 pm
I figured out why the simulated one-electron images appeared to have more noise than the real D4 images. In the real images, I photographed the target so that it filled the frame, so that on the sensor it was a around 3000 pixels high and wide. Then I res'd the images down to 350x350 with Perfect Resize, blew them up to 700x700 with nearest neighbor, JPEG'd them, and posted them. I did the simulated images at 350x350 , blew them up to 700x700 with nearest neighbor, JPEG'd them, and posted them.

It's not the same.

The reduction from roughly 3000x3000 to 350x350 averages out a lot of noise, and the simulated images don't get the benefit of that averaging. I repeated the simulation with 3000x3000 images, and gave then the same processing that the real D4 images got. Now the simulated results are much closer to the real ones. The simulated images don't have the pattern noise of the real ones, because I've made no attempt to simulate that.

ISO 640:

(http://www.kasson.com/ll/UGImageNoiseTest640fs.jpg)

ISO 320:

(http://www.kasson.com/ll/UGImageNoiseTest320fs.jpg)

ISO 160:

(http://www.kasson.com/ll/UGImageNoiseTest160fs.jpg)

ISO 80:

(http://www.kasson.com/ll/UGImageNoiseTest80fs.jpg)

ISO 40:

(http://www.kasson.com/ll/UGImageNoiseTest40fs.jpg)

I'm going to declare victory on the read noise simulation and move on to better PRNU simulation and adding the Bayer CFA.

Jim