Re: Another Offset Question
Posted: Mon Dec 24, 2018 9:09 am
Hi folks,
so I guess I'm arriving a little late at the party here, but I'm going to do my best to provide hopefully definitive answers on how the offset control works and how and why it should be set.
I guess the first question to answer is why do we have an offset control? Essentially the purpose of the offset controlled is to avoid having any pixel readout a value of zero in any image. Why do we want to avoid a value of zero? Because if we get a value of zero we can never be sure that it was truly meant to be a value of zero i.e. that it shouldn't have been a negative pixel value that we didn't get because zero is the smallest value that pixel can readout. This is particularly important when you stack frames after capture.
Consider a situation where a dark area in an image has an average ADU 500 with a variation of between 200 and 800 due to various noise factors (see this thread – viewtopic.php?t=456 – for lots of detail on different types of noise that affect images). That setup would be fine as we would never see pixels with zero value in that region of the image and if we stacked many such images they would stack correctly giving an average value of about 500 in the stack. Now imagine that we turn the offset down so that the average value in that region of the image was no longer 500 but was 100, the random range of pixel values in that area would now really need to be between -200 and 400. However the pixel values that are read out from the camera would be between zero and 400 because any negative value would be reported as zero. When we stack these frames we won't get a correct average value in the stack because all the values that should have been negative being boosted up to 0. This can be a particular problem for master dark frames – if the histogram of the individual dark frames is clipped against the left-hand side then the average value of the master dark will be too high due to the effect described above.
Okay, so we now see why we want an offset control to allow us to ensure that we not getting zero pixel values read out from the sensor but we can still use as much of the sensors ADU ranges possible (a fixed, large offset would also remove zero values from the sensor, but would limit the amount of the ADU range we could use).
How do we set an offset control? The simplest guideline is to take dark frame with all the settings that you intend to use (i.e. correct exposure, temperature, gain et cetera) and adjust the offset to just separate the histogram of that dark frame from the left-hand side. If you don't intend to use dark frames then you could perform the same trick with a light frame (this will likely give you a smaller offset value as the sky background brightness will also tend to shift the histogram peak to the right and separated from the left-hand side of the graph).
The question at the start of this thread was whether the correct offset changes with the gain of the camera and why that should happen. The answer to this is – I think – it depends on the model and make of camera. As we know the width of the histogram peak increases as the gain is increased because gain is effectively just a multiplication factor that is boosting a weak signal into a stronger signal and at the same time changing a narrow histogram peak into a wider one. Inside the actual camera itself both the gain and the offset have to be applied before the analogue to digital conversion stage – the gain is basically a voltage multiplier that is applied to the signal coming from each pixel to make a stronger voltage signal to be fed into the ADC, while the offset is essentially a small extra voltage being added to every pixel to increase the pixel value.
Some camera brands/models seem to auto scale the offset value when the gain is adjusted without requiring adjustments of the actual offset value i.e. if you turn up the gain you will see the histogram peak not only widen but move to the right automatically in order to keep it separated from the left-hand side of the histogram graph. On other types of cameras when you turn up the gain the histogram peak stays in the same place and just gets wider and with such cameras there is a definite requirement to increase the offset value as the gain is increased to ensure separation.
Hope that all makes sense – if there are still unanswered questions lurking in the middle of this thread then please let me know and I'll do my best to answer them if I know the answer.
Cheers, Robin
so I guess I'm arriving a little late at the party here, but I'm going to do my best to provide hopefully definitive answers on how the offset control works and how and why it should be set.
I guess the first question to answer is why do we have an offset control? Essentially the purpose of the offset controlled is to avoid having any pixel readout a value of zero in any image. Why do we want to avoid a value of zero? Because if we get a value of zero we can never be sure that it was truly meant to be a value of zero i.e. that it shouldn't have been a negative pixel value that we didn't get because zero is the smallest value that pixel can readout. This is particularly important when you stack frames after capture.
Consider a situation where a dark area in an image has an average ADU 500 with a variation of between 200 and 800 due to various noise factors (see this thread – viewtopic.php?t=456 – for lots of detail on different types of noise that affect images). That setup would be fine as we would never see pixels with zero value in that region of the image and if we stacked many such images they would stack correctly giving an average value of about 500 in the stack. Now imagine that we turn the offset down so that the average value in that region of the image was no longer 500 but was 100, the random range of pixel values in that area would now really need to be between -200 and 400. However the pixel values that are read out from the camera would be between zero and 400 because any negative value would be reported as zero. When we stack these frames we won't get a correct average value in the stack because all the values that should have been negative being boosted up to 0. This can be a particular problem for master dark frames – if the histogram of the individual dark frames is clipped against the left-hand side then the average value of the master dark will be too high due to the effect described above.
Okay, so we now see why we want an offset control to allow us to ensure that we not getting zero pixel values read out from the sensor but we can still use as much of the sensors ADU ranges possible (a fixed, large offset would also remove zero values from the sensor, but would limit the amount of the ADU range we could use).
How do we set an offset control? The simplest guideline is to take dark frame with all the settings that you intend to use (i.e. correct exposure, temperature, gain et cetera) and adjust the offset to just separate the histogram of that dark frame from the left-hand side. If you don't intend to use dark frames then you could perform the same trick with a light frame (this will likely give you a smaller offset value as the sky background brightness will also tend to shift the histogram peak to the right and separated from the left-hand side of the graph).
The question at the start of this thread was whether the correct offset changes with the gain of the camera and why that should happen. The answer to this is – I think – it depends on the model and make of camera. As we know the width of the histogram peak increases as the gain is increased because gain is effectively just a multiplication factor that is boosting a weak signal into a stronger signal and at the same time changing a narrow histogram peak into a wider one. Inside the actual camera itself both the gain and the offset have to be applied before the analogue to digital conversion stage – the gain is basically a voltage multiplier that is applied to the signal coming from each pixel to make a stronger voltage signal to be fed into the ADC, while the offset is essentially a small extra voltage being added to every pixel to increase the pixel value.
Some camera brands/models seem to auto scale the offset value when the gain is adjusted without requiring adjustments of the actual offset value i.e. if you turn up the gain you will see the histogram peak not only widen but move to the right automatically in order to keep it separated from the left-hand side of the histogram graph. On other types of cameras when you turn up the gain the histogram peak stays in the same place and just gets wider and with such cameras there is a definite requirement to increase the offset value as the gain is increased to ensure separation.
Hope that all makes sense – if there are still unanswered questions lurking in the middle of this thread then please let me know and I'll do my best to answer them if I know the answer.
Cheers, Robin