Commit 89f71186 authored by Samuel Debionne's avatar Samuel Debionne

Update the documentation (build with CMake) and cleanup

parent edffbf3e
......@@ -5,69 +5,52 @@ V4l2 camera
.. image:: linuxtv.png
Intoduction
```````````
This new plugin aims to interface any v4l2 camera devices to LIMA framework. Some USB Webcams have been tested successfully.
Video for Linux 2 supports most of the market products, however you may encountered some limitations using Lima, please report
your problem and or your patch to lima@esrf.fr, we will be happy to improve this code for you.
Introduction
````````````
V4L2 stands for Video for Linux 2. This new plugin aims to interface any v4l2 camera devices to LIMA framework. Some USB Webcams have been tested successfully. Video for Linux 2 supports most of the market products, however you may encountered some limitations using Lima, please report your problem and or your patch to lima@esrf.fr, we will be happy to improve this code for you.
Useful links:
Useful links :
- http://linuxtv.org
- http://en.wikipedia.org/wiki/Video4Linux
Installation & Module configuration
````````````````````````````````````
Depending or your linux flavor you may need to intall/update the v4l2 packages.
the package libv4l-dev is mandatory to compile the lima v4l2 plugin.
Depending or your linux flavor you may need to intall/update the v4l2 packages.
We recommend to install a useful tool **qv4l2** a Qt GUI. You can test your device and check supported video formats
and if the camera is supporting fixed exposure for instance.
The package libv4l-dev is mandatory to compile the lima v4l2 plugin.
- follow the steps for the linux installation :ref:`linux_installation`
- follow the steps for the windows installation :ref:`windows_installation`
We recommend to install a useful tool ``qv4l2``, a Qt GUI. You can test your device and check supported video formats and if the camera is supporting fixed exposure for instance.
The minimum configuration file is *config.inc* :
Follow the generic instructions in :ref:`build_installation`. If using CMake directly, add the following flag:
.. code-block:: sh
COMPILE_CORE=1
COMPILE_SIMULATOR=0
COMPILE_SPS_IMAGE=1
COMPILE_ESPIA=0
COMPILE_FRELON=0
COMPILE_MAXIPIX=0
COMPILE_PILATUS=0
COMPILE_V4L2=1
COMPILE_CBF_SAVING=0
export COMPILE_CORE COMPILE_SPS_IMAGE COMPILE_SIMULATOR \
COMPILE_ESPIA COMPILE_FRELON COMPILE_MAXIPIX COMPILE_PILATUS \
COMPILE_BASLER COMPILE_CBF_SAVING
- start the compilation :ref:`linux_compilation`
-DLIMACAMERA_V4L2=true
- finally for the Tango server installation :ref:`tango_installation`
For the Tango server installation, refers to :ref:`tango_installation`.
Initialisation and Capabilities
````````````````````````````````
Implementing a new plugin for new detector is driven by the LIMA framework but the developer has some freedoms to choose which standard and specific features will be made available. This section is supposed to give you the correct information regarding how the camera is exported within the LIMA framework.
Camera initialisation
......................
The camera will be initialized by creating V4l2::Camera object. The Camera contructor
sets the camera with default parameters, and a device path is required (e.g. /dev/video0)
The camera will be initialized by creating a :cpp:class:`V4l2::Camera` object. The contructor sets the camera with default parameters, and a device path is required, e.g. ``/dev/video0``.
Std capabilites
Std capabilities
................
This plugin has been implement in respect of the mandatory capabilites but with some limitations.
It is mainly a video controller (HwVideoCtrlObj) with the minimum set of of feature for the standard acquisition.
For instance the exposure control can not be available if the camera only support the auto-exposure mode.
This plugin has been implemented in respect of the mandatory capabilites but with some limitations.
It is mainly a video controller, see :cpp:class:`HwVideoCtrlObj`, with a minimum set of feature for standard acquisition. For instance the exposure control can not be available if the camera only support the auto-exposure mode.
* HwDetInfo
getCurrImageType/getDefImageType(): it can change if the video mode change (see HwVideo capability).
setCurrImageType(): It only supports Bpp8 and Bpp16.
......@@ -75,11 +58,11 @@ For instance the exposure control can not be available if the camera only suppor
* HwSync
get/setTrigMode(): Only IntTrig mode is supported.
Optional capabilites
........................
The V4L2 camera plugin is a mostly a **Video** device which provides a limited interface for the acquisition(i.e, exposure, latency ..).
The V4L2 camera plugin is a mostly a **Video** device which provides a limited interface for the acquisition (i.e, exposure, latency ..).
* HwVideo
......@@ -89,7 +72,7 @@ The V4L2 camera plugin is a mostly a **Video** device which provides a limited i
- BAYER_BG8
- BAYER_BG16
**Luminence+chrominance formats**
**Luminence+chrominance formats**
- YUV422
- UYV411
- YUV444
......@@ -104,10 +87,10 @@ The V4L2 camera plugin is a mostly a **Video** device which provides a limited i
- RGB32
**Monochrome formats**
- Y8
- Y8
- Y16
- Y32
- Y64
- Y64
Use get/setMode() methods of the *video* object (i.e CtControl::video()) for accessing the video format.
The lima plugin will initialise the camera to a *preferred* video format by choosing one of the format the camera supports but through ordered
......@@ -117,12 +100,11 @@ The V4L2 camera plugin is a mostly a **Video** device which provides a limited i
Configuration
``````````````
Simply plug your camera (USB device or other interface) on your computer, it should be automatically detected and
a new device file is created like /dev/video0. The new device is maybe owned by **root:video**,so far an other user
cannot access the device. In that case you should update /etc/group to add that user to the video group.
Simply plug your camera (USB device or other interface) on your computer, it should be automatically detected and a new device file is created like ``/dev/video0``. The new device is maybe owned by ``root:video``, so an other user cannot access the device. In that case you should update ``/etc/group`` to add that user to the video group.
How to use
````````````
``````````
This is a python code example for a simple test:
.. code-block:: python
......@@ -130,7 +112,7 @@ This is a python code example for a simple test:
from Lima import v4l2
from lima import Core
#------------------+
# V4l2 device path |
# v
......@@ -168,8 +150,8 @@ This is a python code example for a simple test:
saving.setParameters(pars)
# now ask for and 10 frames
acq.setNbImages(10)
acq.setNbImages(10)
ct.prepareAcq()
ct.startAcq()
......@@ -178,8 +160,6 @@ This is a python code example for a simple test:
while lastimg !=9:
time.sleep(1)
lastimg = ct.getStatus().ImageCounters.LastImageReady
# read the first image
im0 = ct.ReadImage(0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment