From b8e5bbf3ccf95364f004e63c3e147914159dc32c Mon Sep 17 00:00:00 2001 From: tonton th Date: Tue, 29 Dec 2020 00:54:15 +0100 Subject: [PATCH] on verra demain --- Fonderie/crapulator.c | 10 ++++++++-- Fonderie/metriques.c | 2 +- Fonderie/notes.md | 4 ++++ Fonderie/sfx.c | 31 +++++++++++++++++++++++++++++++ Fonderie/sfx.h | 1 + floatimg.h | 2 +- tools/cumulfimgs.c | 7 ++++++- v4l2/grabvidseq.c | 5 +---- 8 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 Fonderie/notes.md diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index 1e3d2390..2df3226f 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -196,6 +196,10 @@ switch (idFx) { /* hipass filter */ retval = insitu_filtre3x3(image, 1); break; + case 20: + retval = octotree_classif(image, 0); + break; + /* here are the glitches */ case 24: /* experiment ! */ @@ -237,8 +241,6 @@ typedef struct { int flags; } Crapulor; - - /* -------------------------------------------------------------- */ char * crap_name_from_number(int num) { @@ -252,10 +254,14 @@ switch (num) { case 9: return "classif0"; case 10: return "binariz"; case 11: return "trinariz"; + case 12: return "smoo2x2"; case 13: return "fltr3x3"; case 14: return "desatur"; + case 15: return "killines"; case 18: return "updown"; + + case 20: return "octoclass"; } return "???"; diff --git a/Fonderie/metriques.c b/Fonderie/metriques.c index c21568bd..c336d01c 100644 --- a/Fonderie/metriques.c +++ b/Fonderie/metriques.c @@ -15,7 +15,7 @@ extern int verbosity; */ int get_float_metric_a(FloatImg *pimg, float *where) { -float means[4]; +float means[4]; /* four values : R G B A */ int foo; #if DEBUG_LEVEL diff --git a/Fonderie/notes.md b/Fonderie/notes.md new file mode 100644 index 00000000..c3cf7c6d --- /dev/null +++ b/Fonderie/notes.md @@ -0,0 +1,4 @@ + + +pipeliner le graber et le fondeur par la SHM ? + diff --git a/Fonderie/sfx.c b/Fonderie/sfx.c index 2dd8e363..371e9216 100644 --- a/Fonderie/sfx.c +++ b/Fonderie/sfx.c @@ -18,6 +18,37 @@ */ extern int verbosity; +/* -------------------------------------------------------------- */ +/* nouveau du 27 decembre 2020, un soir de grand froid... */ + +int octotree_classif(FloatImg *pimg, int notused) +{ +int foo; +float mm[6], means[4]; + +fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, notused); + +foo = fimg_meanvalues(pimg, means); +if (foo) { + fprintf(stderr, "oups %d in meanvalues\n", foo); + return foo; + } +fprintf(stderr, "means: %11f %11f %11f\n", means[0], means[1], means[2]); + +foo = fimg_get_minmax_rgb(pimg, mm); +if (foo) { + fprintf(stderr, "oups %d in get minmax\n", foo); + return foo; + } +fimg_print_minmax(mm, __func__); + +/* + * compute the height center points */ + + + +return -1; +} /* -------------------------------------------------------------- */ /* nouveau du 19 decembre 2020, pour le grand ecran de da Scritch */ diff --git a/Fonderie/sfx.h b/Fonderie/sfx.h index 75666805..d1262d3f 100644 --- a/Fonderie/sfx.h +++ b/Fonderie/sfx.h @@ -4,6 +4,7 @@ int bouger_les_pixels(FloatImg *pimg, int kaboo); +int octotree_classif(FloatImg *pimg, int notused); int mirror_split(FloatImg *pimg, int kaboo); int upside_down(FloatImg *pimg); diff --git a/floatimg.h b/floatimg.h index a62a443e..b405eb15 100644 --- a/floatimg.h +++ b/floatimg.h @@ -3,7 +3,7 @@ * ugly code from tTh */ -#define FIMG_VERSION 115 +#define FIMG_VERSION 116 /* * in memory descriptor diff --git a/tools/cumulfimgs.c b/tools/cumulfimgs.c index 7b89c2fc..c5baf04f 100644 --- a/tools/cumulfimgs.c +++ b/tools/cumulfimgs.c @@ -24,7 +24,9 @@ if (foo) { return foo; } -if (verbosity) fprintf(stderr, "%-20s %d x %d\n",path, numbers[0], numbers[1]); +if (verbosity) { + fprintf(stderr, "%-20s %dx%d\n", path, numbers[0], numbers[1]); + } if (FIMG_TYPE_RGB != numbers[2]) { fprintf(stderr, "file %s, %d : bad type\n", path, numbers[2]); @@ -51,6 +53,7 @@ int main(int argc, char *argv[]) { int foo, idx; int opt; +int compte = 0; int to_gray = 0; char *output_file = "out.fimg"; @@ -97,6 +100,7 @@ for (idx=optind; idx 2) { fprintf(stderr, "xioctl VIDIOC_DQBUF done\n"); fflush(stderr);