Compare commits

..

No commits in common. "f034c77401fd1cdd1f698dc7421b38337ed2b42e" and "3e0b22752091d984ff8f58b2e01f774c1ae1fd69" have entirely different histories.

5 changed files with 13 additions and 42 deletions

View File

@ -124,8 +124,7 @@ int fimg_cos_010(FloatImg *s, FloatImg *d, double maxval);
int fimg_mix_rgb_gray(FloatImg *img, float mix);
int fimg_shift_to_zero(FloatImg *s, FloatImg *d, float coefs[6]);
/* experimental ! */
int fimg_classif_trial(FloatImg *src, FloatImg*dst, float fval, int notused);
int fimg_classif_trial(FloatImg *src, FloatImg*dst, int notused);
/* module funcs/geometry.c */
int fimg_equalize_compute(FloatImg *src, void *vptr, float vmax);

View File

@ -14,14 +14,14 @@ int verbosity;
/* --------------------------------------------------------------------- */
/* nouveau 2 octobre 2020, juste avant sonoptic de la pluie craignos */
int fimg_classif_trial(FloatImg *psrc, FloatImg *pdst, float fval, int notused)
int fimg_classif_trial(FloatImg *psrc, FloatImg *pdst, int notused)
{
float minmax[6], delta[3], baryc[3];
float range, dist, rgb[3], dr, dg, db;
int x, y, on, off;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %f %d )\n", __func__, psrc, pdst, fval, notused);
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, psrc, pdst, notused);
#endif
/* calculer les amplitudes RGB de l'image source */
@ -35,9 +35,9 @@ range = delta[0]; if (delta[1]<range) range=delta[1];
if (delta[2]<range) range=delta[2];
/* convertir le diametre en rayon (magic inside) */
range *= fval;
range /= 2.0;
if (verbosity ) fprintf(stderr, "deltas : %f %f %f / %f\n",
fprintf(stderr, "deltas : %f %f %f / %f\n",
delta[0], delta[1], delta[2], range);
@ -45,8 +45,7 @@ if (verbosity ) fprintf(stderr, "deltas : %f %f %f / %f\n",
baryc[0] = (minmax[1] + minmax[0]) / 2;
baryc[1] = (minmax[3] + minmax[2]) / 2;
baryc[2] = (minmax[5] + minmax[4]) / 2;
if (verbosity) fprintf(stderr, "barycs : %f %f %f\n",
baryc[0], baryc[1], baryc[2]);
fprintf(stderr, "barycs : %f %f %f\n", baryc[0], baryc[1], baryc[2]);
on = off = 0;
@ -67,13 +66,11 @@ for (y=0; y<psrc->height; y++) {
/* action !!! */
if (dist > range) {
/* make our pixel gray-level */
rgb[0] = rgb[1] = rgb[2] = 0.0;
// (rgb[0] + rgb[1] + rgb[2]) / 3.0;
rgb[0] = rgb[1] = rgb[2] =
(rgb[0] + rgb[1] + rgb[2]) / 3.0;
on++;
}
else {
/* the easy part : do nothing */
off++;
}

View File

@ -36,7 +36,7 @@ else {
fimg_clone(&src, &dst, 1);
foo = fimg_classif_trial(&src, &dst, global_fvalue, 0);
foo = fimg_classif_trial(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s: err %d in classif_trial\n", __func__, foo);
return foo;
@ -48,7 +48,7 @@ if (foo) {
return foo;
}
return 0;
return foo;
}
/* --------------------------------------------------------------------- */
/* nouveau 19 aout 2020, le matin avant la canicule */
@ -551,7 +551,6 @@ filename = argv[optind+1];
if (verbosity) {
fprintf(stderr, "running command '%s' on '%s'\n", command, filename);
fprintf(stderr, "global fvalue : %f\n", global_fvalue);
}
opt = lookup_cmd(command);

View File

@ -1,24 +0,0 @@
#!/bin/bash
src=foo.fimg
maxi=90
grabvidseq -s 640x480 -vv -p 0 -n 2000 -c cos01 -o $src
for foo in $(seq 0 $maxi)
do
fval=$(echo "$foo / $maxi" | bc -l)
./t -k $fval -v classif $src
echo $foo $fval
nom=$(printf "v_%03d.pnm" $foo)
cp out.pnm $nom
echo $nom
done
convert -delay 10 v_*.pnm foo.gif

View File

@ -77,7 +77,7 @@ if (foo) {
return -98;
}
foo = fimg_classif_trial(S, D, kf, 0);
foo = fimg_classif_trial(S, D, 0);
if (foo) {
fprintf(stderr, "%s err %d classif_trial %p\n", __func__,
foo, S);