added "classif" kludgy func

This commit is contained in:
2020-10-04 13:05:28 +02:00
parent cf42543659
commit b1bf9715e0
4 changed files with 137 additions and 4 deletions

View File

@@ -14,6 +14,44 @@ int verbosity;
float global_fvalue;
/* --------------------------------------------------------------------- */
int fimg_classif_trial(FloatImg *src, FloatImg*dst, int notused);
int essai_classif(char *infile)
{
FloatImg src, dst;
int foo;
if (NULL != infile) {
fprintf(stderr, "%s: loading %s\n", __func__, infile);
foo = fimg_create_from_dump(infile, &src);
if (foo) {
fprintf(stderr, "%s: error loading '%s'\n", __func__, infile);
return foo;
}
}
else {
fprintf(stderr, "%s : NOT INPUT FILE, FUBAR\n", __func__);
abort();
}
fimg_clone(&src, &dst, 1);
foo = fimg_classif_trial(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s: err %d in classif_trial\n", __func__, foo);
return foo;
}
foo = fimg_save_as_pnm(&dst, "out.pnm", 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
return foo;
}
return foo;
}
/* --------------------------------------------------------------------- */
/* nouveau 19 aout 2020, le matin avant la canicule */
@@ -31,7 +69,6 @@ if (foo) {
return foo;
}
return -7;
}
/* --------------------------------------------------------------------- */
@@ -434,7 +471,7 @@ return 0;
}
/* --------------------------------------------------------------------- */
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
Histo, Hsv };
Histo, Hsv,Classif };
typedef struct {
char *name;
int Cmd;
@@ -451,6 +488,7 @@ Command commands[] = {
{ "wtiff", Wtiff },
{ "histo", Histo },
{ "hsv", Hsv },
{ "classif", Classif },
{ NULL, 0 }
} ;
@@ -547,6 +585,9 @@ switch(opt) {
case Hsv:
foo = fimg_essai_hsv(filename);
break;
case Classif:
foo = essai_classif(filename);
break;
default:
fprintf(stderr, "%s : bad command\n", command);
exit(1);