forked from tTh/FloatImg
fixing random bugs
This commit is contained in:
parent
9f5d5e2763
commit
d294102ca4
|
@ -84,7 +84,7 @@ for (foo=0; foo<(head->width*head->height); foo++) {
|
||||||
add = head->R[foo];
|
add = head->R[foo];
|
||||||
add += head->G[foo];
|
add += head->G[foo];
|
||||||
add += head->B[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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,11 +168,12 @@ if ( flags & 1 ) {
|
||||||
head->fval, head->count,
|
head->fval, head->count,
|
||||||
head->fval * head->count);
|
head->fval * head->count);
|
||||||
fk = (head->fval * head->count) / 65535.0;
|
fk = (head->fval * head->count) / 65535.0;
|
||||||
|
fprintf(fp, "# fval/count %f %d\n", head->fval, head->count);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
maximum = fimg_get_maxvalue(head);
|
maximum = fimg_get_maxvalue(head);
|
||||||
fk = maximum / 65535.0;
|
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");
|
fprintf(fp, "65535\n");
|
||||||
|
|
|
@ -17,7 +17,7 @@ rgb2fimg.o: rgb2fimg.c funcs.h Makefile
|
||||||
v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile
|
v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile
|
||||||
gcc ${COPT} -c $<
|
gcc ${COPT} -c $<
|
||||||
|
|
||||||
grabvidseq: grabvidseq.c Makefile rgb2fimg.o
|
grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o
|
||||||
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@
|
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@
|
||||||
|
|
||||||
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o
|
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o
|
||||||
|
|
|
@ -316,7 +316,7 @@ if (to_gray) {
|
||||||
if (verbosity) fprintf(stderr, "saving to '%s'\n", outfile);
|
if (verbosity) fprintf(stderr, "saving to '%s'\n", outfile);
|
||||||
|
|
||||||
if (upscaling) { /* nasty workaround */
|
if (upscaling) { /* nasty workaround */
|
||||||
cumul.count /= 4;
|
cumul.count /= 4; /* WTF ? */
|
||||||
}
|
}
|
||||||
|
|
||||||
foo = fimg_save_as_pnm(&cumul, outfile, 1);
|
foo = fimg_save_as_pnm(&cumul, outfile, 1);
|
||||||
|
|
Loading…
Reference in New Issue