2020-09-29 19:41:53 +11:00
|
|
|
% --------------------------------------------------------------------
|
|
|
|
% nouveau juillet 2014 à mixart-myrys
|
|
|
|
% --------------------------------------------------------------------
|
|
|
|
|
|
|
|
\chapter{Webcam}
|
2020-11-02 05:32:45 +11:00
|
|
|
\label{chap:webcam}
|
2020-09-29 19:41:53 +11:00
|
|
|
\index{webcam}
|
|
|
|
|
2020-11-03 09:08:45 +11:00
|
|
|
Sous Linux, c'est quand même un peu tordu%
|
|
|
|
\footnote{Avis personnel !}, dans le même genre
|
|
|
|
que la pile son, quoi...
|
|
|
|
Nous allonc commencer par les principes et outils
|
|
|
|
de base, puis passer à plus
|
2020-09-29 19:41:53 +11:00
|
|
|
simple : juste tenter de prendre une photo avec une
|
|
|
|
\textsl{webcam} classique en USB, et d'enregistrer cette
|
|
|
|
image.
|
|
|
|
|
2020-11-02 05:32:45 +11:00
|
|
|
% --------------------------------------------------------------------
|
|
|
|
|
|
|
|
\section{v4l2}\index{v4l2}
|
|
|
|
|
|
|
|
\textsl{Video For Linux, second edition.}
|
|
|
|
|
2020-11-03 09:08:45 +11:00
|
|
|
\begin{verbatim}
|
|
|
|
tth@delirium:~/Essais/Fonderie$ v4l2-ctl --list-formats-ext
|
|
|
|
ioctl: VIDIOC_ENUM_FMT
|
|
|
|
Type: Video Capture
|
|
|
|
|
|
|
|
[0]: 'MJPG' (Motion-JPEG, compressed)
|
|
|
|
Size: Discrete 640x480
|
|
|
|
Interval: Discrete 0.033s (30.000 fps)
|
|
|
|
Size: Discrete 320x240
|
|
|
|
Interval: Discrete 0.033s (30.000 fps)
|
|
|
|
Size: Discrete 1920x1080
|
|
|
|
Interval: Discrete 0.033s (30.000 fps)
|
|
|
|
Size: Discrete 1280x720
|
|
|
|
Interval: Discrete 0.033s (30.000 fps)
|
|
|
|
\end{verbatim}
|
|
|
|
|
2020-11-10 12:40:30 +11:00
|
|
|
Question : quelle méthode utiliser pour avoir la même chose avec
|
2023-10-09 06:56:41 +11:00
|
|
|
des lignes de code écrites en C ? Il faut passer par une suite d'appels
|
|
|
|
\texttt{ioctl}\index{ioctl}.
|
2020-11-10 12:40:30 +11:00
|
|
|
|
2020-11-02 05:32:45 +11:00
|
|
|
% --------------------------------------------------------------------
|
|
|
|
|
2020-09-29 19:41:53 +11:00
|
|
|
\section{vgrabbj}
|
|
|
|
\index{vgrabbj}
|
|
|
|
|
2020-11-10 12:40:30 +11:00
|
|
|
|
|
|
|
|
2020-09-29 19:41:53 +11:00
|
|
|
D'après la manpage :
|
|
|
|
« \textit{
|
|
|
|
vgrabbj is a program that will grab images from any v4l-capable device
|
|
|
|
which supports one of the rgb24, rgb32, yuv420, yuv420p, yuyv, or
|
|
|
|
yuv422 palettes and saves the image as a .jpg, .png, or .pnm file.
|
|
|
|
} »
|
|
|
|
|
|
|
|
Quelques options à connaitre : \texttt{-S} échange des
|
|
|
|
deux composantes R et B; \texttt{-s <device>} affiche
|
|
|
|
les capacités du périphérique v4l\index{v4l}.
|
|
|
|
|
|
|
|
|
|
|
|
% --------------------------------------------------------------------
|
2020-11-03 09:08:45 +11:00
|
|
|
\section{Cheese}
|
|
|
|
|
|
|
|
\begin{quote}
|
|
|
|
cheese uses your webcam to take photos and videos, applies fancy special
|
|
|
|
effects and lets you share the fun with others. It was written as part of
|
|
|
|
Google's 2007 Summer of Code lead by daniel g. siegel and mentored by Raphaël
|
|
|
|
Slinckx. Under the hood, Cheese uses GStreamer to apply fancy effects to photos
|
|
|
|
and videos. With Cheese it is easy to take photos of you, your friends, pets or
|
|
|
|
whatever you want and share them with others. After the success of the Summer
|
|
|
|
of Code, the development continued and we are still looking for people with
|
|
|
|
nice ideas and patches ;)
|
|
|
|
\end{quote}
|
|
|
|
|
2020-09-29 19:41:53 +11:00
|
|
|
% --------------------------------------------------------------------
|
|
|
|
|
2021-10-05 07:24:01 +11:00
|
|
|
\section{Kinect} \index{Kinect}
|
|
|
|
|
|
|
|
Bon, voilà un nouveau gadget ;)
|
|
|
|
|
|
|
|
À priori, la partie caméra RGB est gérée classiquement par v4l2,
|
|
|
|
mais le coté spécifique, je ne sais pas qu'en faire...
|
|
|
|
|
|
|
|
% --------------------------------------------------------------------
|
|
|
|
|