Sogo Mineo reports on slack:
In the dynamic detection, (1) I suspect that the call to `tweakBackground()` at
is not effective because it modifies only `exposure` and it does not modify `middle` , which is passed to `applyThreshold()` . The tweaked `exposure` will be thrown away when the instruction pointer goes out of the with-clause.
I agree with his analysis. I believe we do eventually make the tweak permanent, by calling tweakBackground a second time near the end of detectFootprints, this time on the image that is retained. And the initial call tweakBackground does have a small affect, because the temporary image it is operating on is used to refine the set of peaks after the footprint regions have already been determined when doTempLocalBackground is true. But it seems like it was intended to affect the image used for footprint-region detection ("middle") as well.