Compare commits

..

3 Commits

Author SHA1 Message Date
fdcc0781eb fix in fimg_auto_shift_to_zero 2021-02-25 08:23:27 +01:00
0a1260eb6f singlepass verbosity 2021-02-24 17:48:16 +01:00
6886fb4167 misplaced debug message 2021-02-24 16:50:14 +01:00
4 changed files with 23 additions and 5 deletions

View File

@ -9,8 +9,8 @@ FILTRES=$(./t -L | awk 'NR>1 { print $1 }' | sort)
rm /tmp/fstack*.png
# SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1)
SRC=mire.fimg
SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1)
# SRC=mire.fimg
for F in $FILTRES
do

View File

@ -16,14 +16,14 @@ int x, y, xe, ye;
int off;
double accus[3], divisor;
xe = geom[0] + geom[2];
ye = geom[1] + geom[3];
#if DEBUG_LEVEL
fprintf(stdout, "geom: %5d %5d %5d %5d\n",
geom[0], geom[1], geom[2], geom[3]);
#endif
xe = geom[0] + geom[2];
ye = geom[1] + geom[3];
accus[0] = accus[1] = accus[2] = 0.0;
for (y=geom[1]; y<ye; y++) {
for (x=geom[0]; x<xe; x++) {

View File

@ -166,6 +166,13 @@ if (foo) {
exit(1);
}
if (verbosity) {
fprintf(stderr, "input glob %s\n", globbing);
fprintf(stderr, "filter chain %s\n", filterchain);
fprintf(stderr, "ourput dir %s\n", outdir);
fprintf(stderr, "do xper %d\n", do_xper);
}
foo = run_the_singlepass(globbing, outdir, FILTERS);
fprintf(stderr, "\n\tRun the single pass --> %d\n", foo);

View File

@ -71,10 +71,14 @@ return 0;
}
/* -------------------------------------------------------------- */
/*
* I think that this function is fully buggy
*/
int fimg_auto_shift_to_zero(FloatImg *src, FloatImg *dst)
{
float coefs[6];
int foo;
float minima = 1e7; /* magic value ? */
if (FIMG_TYPE_RGB != src->type) {
fprintf(stderr, "%s: bad image type %d\n", __func__, src->type);
@ -87,6 +91,13 @@ if (foo) {
return foo;
}
/* crude hack for now */
if (coefs[0] < minima) minima = coefs[0];
if (coefs[2] < minima) minima = coefs[2];
if (coefs[4] < minima) minima = coefs[4];
coefs[0] = coefs[2] = coefs[4] = minima;
foo = fimg_shift_to_zero(src, dst, coefs);
if (foo) {
fprintf(stderr, "%s WTF?\n", __func__);