forked from tTh/FloatImg
better plotting
This commit is contained in:
parent
711e54fe43
commit
6228533479
@ -18,7 +18,9 @@ float maxval;
|
|||||||
int x, y, idx;
|
int x, y, idx;
|
||||||
float rgb[3], moy;
|
float rgb[3], moy;
|
||||||
|
|
||||||
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, src, ghist, sz);
|
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, src, ghist, sz);
|
||||||
|
#endif
|
||||||
|
|
||||||
maxval = fimg_get_maxvalue(src);
|
maxval = fimg_get_maxvalue(src);
|
||||||
|
|
||||||
@ -46,7 +48,7 @@ return -66;
|
|||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
#define NSLICES 999
|
#define NSLICES 1000
|
||||||
|
|
||||||
int fimg_essai_histo(FloatImg *src, char *outpic, int k)
|
int fimg_essai_histo(FloatImg *src, char *outpic, int k)
|
||||||
{
|
{
|
||||||
@ -60,14 +62,20 @@ memset(histo, 0, NSLICES*sizeof(long));
|
|||||||
|
|
||||||
foo = fimg_calcul_histo(src, histo, NSLICES);
|
foo = fimg_calcul_histo(src, histo, NSLICES);
|
||||||
|
|
||||||
for (foo=0; foo<NSLICES; foo++) {
|
// for (foo=0; foo<NSLICES; foo++) {
|
||||||
printf("%7d %ld\n", foo, histo[foo]);
|
// printf("%7d %ld\n", foo, histo[foo]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
pipe = popen("gnuplot", "w");
|
pipe = popen("gnuplot", "w");
|
||||||
fprintf(pipe, "set term png size 1000,400\n");
|
fprintf(pipe, "set term png size 1024,512\n");
|
||||||
fprintf(pipe, "set output \"histo.png\"\n");
|
fprintf(pipe, "set grid\n");
|
||||||
fprintf(pipe, "plot 'toto' with lines\n");
|
fprintf(pipe, "set output \"%s\"\n", outpic);
|
||||||
|
fprintf(pipe, "plot '/dev/stdin' with lines\n");
|
||||||
|
|
||||||
|
for (foo=0; foo<NSLICES; foo++) {
|
||||||
|
fprintf(pipe, "%d %ld\n", foo, histo[foo]);
|
||||||
|
}
|
||||||
|
|
||||||
fclose(pipe);
|
fclose(pipe);
|
||||||
|
|
||||||
|
|
||||||
|
@ -405,7 +405,6 @@ return 0;
|
|||||||
/* func in histogram.c */
|
/* func in histogram.c */
|
||||||
int fimg_essai_histo(FloatImg *src, char *outpic, int k);
|
int fimg_essai_histo(FloatImg *src, char *outpic, int k);
|
||||||
|
|
||||||
|
|
||||||
int essai_histogramme(char *fname, int k)
|
int essai_histogramme(char *fname, int k)
|
||||||
{
|
{
|
||||||
FloatImg fimg;
|
FloatImg fimg;
|
||||||
|
Loading…
Reference in New Issue
Block a user