fimg_contour_2x2 is working !!!

This commit is contained in:
2020-10-07 11:32:23 +02:00
parent a3e2cf55fc
commit 6a33b1d318
5 changed files with 127 additions and 8 deletions

View File

@@ -14,6 +14,44 @@ int verbosity;
float global_fvalue;
/* --------------------------------------------------------------------- */
/*
* nouveau 5 octobre 2020 pendant sonoptic
*/
int essai_contour_2x2(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_contour_2x2(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s: err %d in contour_2x2\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 0;
}
/* --------------------------------------------------------------------- */
/*
* nouveau 5 octobre 2020 pendant sonoptic
@@ -473,7 +511,7 @@ return 0;
}
/* --------------------------------------------------------------------- */
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
Histo, Hsv,Classif };
Histo, Hsv, Classif, Ctr2x2 };
typedef struct {
char *name;
int Cmd;
@@ -491,6 +529,7 @@ Command commands[] = {
{ "histo", Histo },
{ "hsv", Hsv },
{ "classif", Classif },
{ "ctr2x2", Ctr2x2 },
{ NULL, 0 }
} ;
@@ -592,6 +631,9 @@ switch(opt) {
case Classif:
foo = essai_classif(filename);
break;
case Ctr2x2:
foo = essai_contour_2x2(filename);
break;
default:
fprintf(stderr, "%s : bad command\n", command);
exit(1);