From 9f5d5e27630cb294f0ccad8f5b739b5ae9e09bfb Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 17 Sep 2019 11:43:06 +0200 Subject: [PATCH] bug in upscaling count computation, workaround --- v4l2/grabvidseq.c | 6 ++++++ v4l2/rgb2fimg.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index f0dff58a..04d20b00 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -305,6 +305,7 @@ t_final = fimg_timer_get(0); fprintf(stderr, "pid %d : elapsed %g s -> %.2f fps\n", getpid(), t_final, (double)nbre_capt / t_final); + #if SAVE_AS_CUMUL if (to_gray) { if (verbosity) fputs("converting to gray\n", stderr); @@ -313,6 +314,11 @@ if (to_gray) { // save cumul to file if (verbosity) fprintf(stderr, "saving to '%s'\n", outfile); + +if (upscaling) { /* nasty workaround */ + cumul.count /= 4; + } + foo = fimg_save_as_pnm(&cumul, outfile, 1); // free buffers diff --git a/v4l2/rgb2fimg.c b/v4l2/rgb2fimg.c index f39dccba..79bdb7b2 100644 --- a/v4l2/rgb2fimg.c +++ b/v4l2/rgb2fimg.c @@ -45,7 +45,9 @@ for (y=0; ycount++; /* one more frame in the accumulator */ return -1; }