I have seen the timelapse from the moon
Looks good….
I think it’s really hard to try with condition behind the tree. On the beginning it looks a little bit overexposed.
At the very beginning, it takes quite a while for the algorithm to reach steady state, because the initial exposure is for the whole scene and very far from correct for the moon. When less than the whole moon is visible, there is still some over-exposure. Some issues with the exposure algorithm also make it react more slowly than it should.
On the end you see really nice the structure of the moon. I would be interested, which parameter you are used (and focal length) and to see the plot from the run.
This was some code I was testing that isn't in the last version I posted. I've spent some time working on getting better results from small over-exposure limits, but the current exposure code has some problems. There's a couple of other tests on my youtube.
In the original code, there was always a "meter limit", which eventually balances any change caused by over or under protection (by ramping up the "weight" described in
http://chdk.setepontos.com/index.php?topic=11081.msg120803#msg120803) This doesn't work well for the moon at night, because the meter essentially goes to black level.
In the script used for that moon rise, I made the weight not ramp up. However, the meter still has it's normal weight, meaning that when the meter is far below the target value, it will still add up to 1/2 the "max ev change" in the wrong direction. This means that it still balances out the over exposure protection, just at a lower level. It also slows down the reaction time.
I have some ideas about how to deal with this (more options!) but I haven't gotten back to working on the code yet, which is why I hadn't posted.
The settings, aside from the customization above, were
meter size: 90% in each direction
meter step: 15
max ev change: 1/3
bv ev shift: 40
bv ev shift base: 9.5
max tv: 1 sec
iso adj tv 0.25 sec
max iso: 400
overexp thresh: 5 (0.05%)
overexp ev range: 1/2
underexp: disabled
histo step: 11
Focal length is ~211 (35 mm equivalent)
Note this was done on sx160, not the D10 I usually use for testing.
Chart and CSV are attached. Note the "over_frac" (in %) is on the right hand scale. You can see it does hover around 0.05 for most of the time. Because of the slope parameter in the over exposure weight calculation, it actually balances meter at 0.055.
Is there any reason, why you limited minimum Histogram step to 9?
The histogram precision is parts per 100k. On a 12MP cam, 9 gives you ~300k samples, so I don't think going to lower step sizes will help much. The time required goes up quickly with smaller steps because it's a square. Higher precision is possible, but with the kind of calculations the current code does on the results, it is gets quite easy to run into overflow.