Compare commits
No commits in common. "85c6e943f3a49014805e91b84555d3bed5aa42ad" and "6fe06f695ad4cd1786969988e1499495a684ef1e" have entirely different histories.
85c6e943f3
...
6fe06f695a
@ -406,9 +406,6 @@ do
|
|||||||
done
|
done
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
En fait, je n'ai pas la moindre idée de ce que peut bien
|
|
||||||
faire ce code\dots
|
|
||||||
|
|
||||||
% -------------------------------------------------------------------
|
% -------------------------------------------------------------------
|
||||||
\section{Video for Linux}\index{v4l2}
|
\section{Video for Linux}\index{v4l2}
|
||||||
|
|
||||||
@ -436,41 +433,15 @@ options :
|
|||||||
-n NNN how many frames ?
|
-n NNN how many frames ?
|
||||||
-O ./ set Output dir
|
-O ./ set Output dir
|
||||||
-o bla set output filename
|
-o bla set output filename
|
||||||
-p NN.N delay between frames
|
-p NN.N period in seconds
|
||||||
-s WxH size of capture
|
-s WxH size of capture
|
||||||
-u try upscaling...
|
-u try upscaling...
|
||||||
-v increase verbosity
|
-v increase verbosity
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
La plupart de ces options ont un usage quasi-évidents.
|
|
||||||
L'option \texttt{-s} doit correspondre à une des
|
|
||||||
résolutions possible de votre capteur.
|
|
||||||
|
|
||||||
\subsubsection{Upscaling}\index{upscaling}\label{upscaling}
|
|
||||||
|
|
||||||
La fonction que j'ai appelée \textsl{upscaling} est un petit
|
|
||||||
hack qui permet de doubler artificiellement la résolution
|
|
||||||
de l'image, en profitant du fait que l'on est capable
|
|
||||||
de prendre $N$ images en rafale.
|
|
||||||
|
|
||||||
Pour être rigoureux dans la prise de vue, ce $N$ doit
|
|
||||||
être un multiple de 4.
|
|
||||||
|
|
||||||
\subsection{video-infos}\index{video-infos}\label{video-infos}
|
\subsection{video-infos}\index{video-infos}\label{video-infos}
|
||||||
|
|
||||||
Que contient, que peut faire mon périphérique \textsl{àlc} ?
|
Que contient, que peut faire mon périphérique \textsl{àlc} ?
|
||||||
Quelles sont ses possibilités de réglage ?
|
|
||||||
|
|
||||||
\begin{verbatim}
|
|
||||||
tth@debian:~/Devel/FloatImg$ v4l2/video-infos -h
|
|
||||||
Options :
|
|
||||||
-d select the video device
|
|
||||||
-K set the K parameter
|
|
||||||
-l list video devices
|
|
||||||
-T bla add a title
|
|
||||||
-v increase verbosity
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
|
|
||||||
% -------------------------------------------------------------------
|
% -------------------------------------------------------------------
|
||||||
\section{Et pour la suite ?}
|
\section{Et pour la suite ?}
|
||||||
|
@ -32,10 +32,6 @@ typedef struct {
|
|||||||
#define FIMG_TYPE_RGB 3
|
#define FIMG_TYPE_RGB 3
|
||||||
#define FIMG_TYPE_RGBA 4
|
#define FIMG_TYPE_RGBA 4
|
||||||
|
|
||||||
#define FILE_TYPE_FIMG 1
|
|
||||||
#define FILE_TYPE_PNM 2
|
|
||||||
#define FILE_TYPE_PNG 3
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* core module
|
* core module
|
||||||
*/
|
*/
|
||||||
@ -95,8 +91,6 @@ int fimg_draw_something(FloatImg *fimg);
|
|||||||
|
|
||||||
int parse_WxH(char *str, int *pw, int *ph);
|
int parse_WxH(char *str, int *pw, int *ph);
|
||||||
int parse_double(char *str, double *dptr);
|
int parse_double(char *str, double *dptr);
|
||||||
int format_from_extension(char *fname);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
28
funcs/t.c
28
funcs/t.c
@ -9,7 +9,7 @@
|
|||||||
#include "../floatimg.h"
|
#include "../floatimg.h"
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int essai_parse_double(void)
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int foo;
|
int foo;
|
||||||
double dval;
|
double dval;
|
||||||
@ -34,29 +34,3 @@ printf("%-10s -> %3d %g\n", str, foo, dval);
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int essai_detect_type(void)
|
|
||||||
{
|
|
||||||
int foo;
|
|
||||||
char *fname;
|
|
||||||
|
|
||||||
foo = format_from_extension(fname="foo.fimg");
|
|
||||||
printf("%-10s %d\n\n", fname, foo);
|
|
||||||
|
|
||||||
foo = format_from_extension(fname="foo.pNm");
|
|
||||||
printf("%-10s %d\n\n", fname, foo);
|
|
||||||
|
|
||||||
foo = format_from_extension(fname="foo.xyzzy");
|
|
||||||
printf("%-10s %d\n\n", fname, foo);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
int foo;
|
|
||||||
|
|
||||||
foo = essai_detect_type();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "../floatimg.h"
|
#include "../floatimg.h"
|
||||||
|
|
||||||
@ -42,24 +42,3 @@ if (1 == foo) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int format_from_extension(char *fname)
|
|
||||||
{
|
|
||||||
char *cptr;
|
|
||||||
|
|
||||||
cptr = rindex(fname, '.');
|
|
||||||
if (NULL==cptr) {
|
|
||||||
fprintf(stderr, "do dot in %s\n", fname);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
|
||||||
fprintf(stderr, "[%s] --> [%s]\n", fname, cptr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!strcasecmp(cptr, ".pnm")) return FILE_TYPE_PNM;
|
|
||||||
if (!strcasecmp(cptr, ".fimg")) return FILE_TYPE_FIMG;
|
|
||||||
if (!strcasecmp(cptr, ".png")) return FILE_TYPE_PNG;
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
@ -301,30 +301,22 @@ for (i = 0; i < nbre_capt; i++) {
|
|||||||
|
|
||||||
puts(""); fflush(stdout);
|
puts(""); fflush(stdout);
|
||||||
|
|
||||||
if (verbosity) {
|
t_final = fimg_timer_get(0);
|
||||||
t_final = fimg_timer_get(0);
|
fprintf(stderr, "pid %d : elapsed %g s -> %.2f fps\n", getpid(),
|
||||||
fprintf(stderr, "pid %d : elapsed %g s -> %.2f fps\n", getpid(),
|
|
||||||
t_final, (double)nbre_capt / t_final);
|
t_final, (double)nbre_capt / t_final);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
#if SAVE_AS_CUMUL
|
||||||
if (to_gray) {
|
if (to_gray) {
|
||||||
if (verbosity) fputs("converting to gray\n", stderr);
|
if (verbosity) fputs("converting to gray\n", stderr);
|
||||||
foo = fimg_to_gray(&cumul);
|
foo = fimg_to_gray(&cumul);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SAVE_AS_CUMUL
|
|
||||||
// save cumul to file
|
// save cumul to file
|
||||||
if (verbosity) fprintf(stderr, "saving cumul to '%s'\n", outfile);
|
if (verbosity) fprintf(stderr, "saving to '%s'\n", outfile);
|
||||||
|
|
||||||
|
foo = fimg_save_as_pnm(&cumul, outfile, 1);
|
||||||
|
|
||||||
foo = format_from_extension(outfile);
|
|
||||||
switch (foo) {
|
|
||||||
case FILE_TYPE_FIMG:
|
|
||||||
foo = fimg_dump_to_file(&cumul, outfile, 0);
|
|
||||||
break;
|
|
||||||
case FILE_TYPE_PNM:
|
|
||||||
foo = fimg_save_as_pnm(&cumul, outfile, 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// free buffers
|
// free buffers
|
||||||
fimg_destroy(&cumul);
|
fimg_destroy(&cumul);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user