Thanks for the update. I think we're still trying to catch up with all the information here, plus of course we don't know anything about this rpicam-ascom-alpaca software.
Firstly, from what I understand about the first graph, you're capturing raw frames and measuring the average pixel value of dark frames. The pixel values are definitely stretched by a factor of 16 (here, ChatGPT seems to have a slightly elaborate way of writing the number "16"), so the nominal value should be 4096. What I'd be interested to see is how the points relate both to the actual exposure, and the actual analogue gain. By which I mean, fetching from the image metadata the true values that the sensor actually applied, rather than the values that (we think) we asked for. If there is any kind of pattern, then you could obviously model a more accurate value for the downstream processing that you do.
The second graph with the "plateau" is a funny one. For all the world it looks to me like the AGC is still running in some way. The "plateau" is where the algorithm can achieve the desired target level. The steep section to the left is where the gain is cranked right up, but it can't be brightened enough. To the right it has lower gain, therefore is shallower, but can't be made darker because the gain won't go lower. Note that the right hand end of the curve dipping lower is common when pixels are starting to saturate - only unsaturated pixels will continue to get brighter as the exposure increases further. I don't know if that's likely in your use case.
Having said that, I see that the AGC/AEC is indeed disabled (here), so it doesn't seem like that should happen. On the other hand, there's a mysterious "gainvalue" being used, and I can't really see what that's doing. Again, I think it would be good to see these values recorded along with the *true* exposure and gain values that the sensor applied (not the ones we asked for). There's quite a lot of code there, so probably someone who has some familiarity with it could comment on what that gainvalue is.
So sorry if I haven't particularly shed any more light on things, but I can't escape the feeling that I would really want to have clear confirmation what the camera settings really were in some of these situations. Maybe that would provide some clues as to what one might look at next.
Firstly, from what I understand about the first graph, you're capturing raw frames and measuring the average pixel value of dark frames. The pixel values are definitely stretched by a factor of 16 (here, ChatGPT seems to have a slightly elaborate way of writing the number "16"), so the nominal value should be 4096. What I'd be interested to see is how the points relate both to the actual exposure, and the actual analogue gain. By which I mean, fetching from the image metadata the true values that the sensor actually applied, rather than the values that (we think) we asked for. If there is any kind of pattern, then you could obviously model a more accurate value for the downstream processing that you do.
The second graph with the "plateau" is a funny one. For all the world it looks to me like the AGC is still running in some way. The "plateau" is where the algorithm can achieve the desired target level. The steep section to the left is where the gain is cranked right up, but it can't be brightened enough. To the right it has lower gain, therefore is shallower, but can't be made darker because the gain won't go lower. Note that the right hand end of the curve dipping lower is common when pixels are starting to saturate - only unsaturated pixels will continue to get brighter as the exposure increases further. I don't know if that's likely in your use case.
Having said that, I see that the AGC/AEC is indeed disabled (here), so it doesn't seem like that should happen. On the other hand, there's a mysterious "gainvalue" being used, and I can't really see what that's doing. Again, I think it would be good to see these values recorded along with the *true* exposure and gain values that the sensor applied (not the ones we asked for). There's quite a lot of code there, so probably someone who has some familiarity with it could comment on what that gainvalue is.
So sorry if I haven't particularly shed any more light on things, but I can't escape the feeling that I would really want to have clear confirmation what the camera settings really were in some of these situations. Maybe that would provide some clues as to what one might look at next.
Statistics: Posted by therealdavidp — Fri Dec 13, 2024 3:24 pm