commit bf9f54f4b6da395ab21f867f2016693ef965f806
parent 61583fa27a1d20c938460c5fa3f01039a27cde06
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 1 Oct 2018 11:09:58 +0200
Dump the std error of the pixels in addition of their luminance.
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/htrdr.c b/src/htrdr.c
@@ -126,9 +126,17 @@ dump_accum_buffer
const struct htrdr_accum* accums = htrdr_buffer_at(buf, x, y);
int i;
FOR_EACH(i, 0, 3) {
- const double E = accums[i].nweights
- ? accums[i].sum_weights / (double)accums[i].nweights : 0;
- fprintf(stream, "%g ", E);
+ const double N = (double)accums[i].nweights;
+ double E = 0;
+ double V = 0;
+ double SE = 0;
+
+ if(accums[i].nweights) {
+ E = accums[i].sum_weights / N;
+ V = MMAX(accums[i].sum_weights_sqr / N - E*E, 0);
+ SE = sqrt(V/N);
+ }
+ fprintf(stream, "%g %g ", E, SE);
}
fprintf(stream, "\n");
}