introduction des ajustements de contraste

This commit is contained in:
2019-11-15 10:39:22 +01:00
parent 210af322b0
commit c7a428c5f0
6 changed files with 60 additions and 33 deletions

View File

@@ -33,6 +33,9 @@ if (FIMG_TYPE_RGB != src->type) {
if (FIMG_TYPE_GRAY != dst->type) {
fprintf(stderr, "%s : bad dst type %d on %p\n", __func__,
dst->type, dst);
/*
* may be we can convert dst picture on the fly ?
*/
return -9;
}

View File

@@ -1,21 +1,23 @@
#!/bin/bash
grabvidseq -s 960x720 -n 600 -p 0.5 -vv -g -o original.fimg
../v4l2/grabvidseq -s 960x720 -n 10000 -p 0.078 \
-vv -g -c none \
-o original.fimg
make t && ./t
for picz in original power2 squareroot cos_01
do
echo _______________ ${picz}
echo _______________________ ${picz}
# ../tools/fimgstats -v ${picz}.fimg
../tools/fimg2pnm -v ${picz}.fimg ${picz}.pnm
convert -pointsize 36 \
-fill white -annotate +10+28 "${picz}" \
-fill black -annotate +12+30 "${picz}" \
convert -pointsize 48 \
-fill black -annotate +14+40 "${picz}" \
-fill white -annotate +16+42 "${picz}" \
${picz}.pnm ${picz}.png
rm ${picz}.pnm

24
lib/t.c
View File

@@ -13,29 +13,6 @@
int verbosity;
/* ---------------------------------------------------------------- */
int petit_dessin(FloatImg *img)
{
int x, y;
float r, g, b;
for (y=0; y<img->height; y++) {
r = (float)y / (float)img->height;
for (x=0; x<img->width; x++) {
g = (float)x / (float)img->width;
b = 0.0;;
fimg_plot_rgb(img, x, y, r, g, b);
}
}
return -1;
}
/* ---------------------------------------------------------------- */
int essai_2gray(FloatImg *picz, char *outname)
@@ -77,7 +54,6 @@ double maxi;
foo = fimg_create_from_dump(fname, &dessin);
foo = fimg_clone(&dessin, &copy, 0);
maxi = (double)fimg_get_maxvalue(&dessin);
fprintf(stderr, "image source valeur maxi = %f\n", maxi);