diff --git a/lib/fimg-math.c b/lib/fimg-math.c index df470b3b..d8513b04 100644 --- a/lib/fimg-math.c +++ b/lib/fimg-math.c @@ -84,7 +84,7 @@ for (foo=0; foo<(head->width*head->height); foo++) { add = head->R[foo]; add += head->G[foo]; add += head->B[foo]; - head->R[foo] = head->G[foo] = head->B[foo] = add; + head->R[foo] = head->G[foo] = head->B[foo] = add / 3.0; } return -1; } diff --git a/lib/fimg-pnm.c b/lib/fimg-pnm.c index 5af3f63a..16656a65 100644 --- a/lib/fimg-pnm.c +++ b/lib/fimg-pnm.c @@ -168,11 +168,12 @@ if ( flags & 1 ) { head->fval, head->count, head->fval * head->count); fk = (head->fval * head->count) / 65535.0; + fprintf(fp, "# fval/count %f %d\n", head->fval, head->count); } else { maximum = fimg_get_maxvalue(head); fk = maximum / 65535.0; - fprintf(fp, "# maxval %15f\n# divisor %15f\n", maximum, fk); + fprintf(fp, "# maxval %15f\n# divisor %15f\n", maximum, fk); } fprintf(fp, "65535\n"); diff --git a/v4l2/Makefile b/v4l2/Makefile index fe6c561f..690aa7a6 100644 --- a/v4l2/Makefile +++ b/v4l2/Makefile @@ -17,7 +17,7 @@ rgb2fimg.o: rgb2fimg.c funcs.h Makefile v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile gcc ${COPT} -c $< -grabvidseq: grabvidseq.c Makefile rgb2fimg.o +grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@ video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index 04d20b00..00c577f7 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -316,7 +316,7 @@ if (to_gray) { if (verbosity) fprintf(stderr, "saving to '%s'\n", outfile); if (upscaling) { /* nasty workaround */ - cumul.count /= 4; + cumul.count /= 4; /* WTF ? */ } foo = fimg_save_as_pnm(&cumul, outfile, 1);