wiki:PacpusSensors/OpencvVideo

OpencvVideo plugin

Goal

The OpencvVideo plugin is in charge of capturing a video with a webcam on linux.

Driver installation

Linux driver

There is no driver to install, it's native.

Windows driver

TODO

Compilation

First, make sure the CMakeList.txt at the root of the directory is well configured (into trunk/). In order to install the OpencvVideo plugin, modify the file and verify you have the following line :

add_subdirectory(OpencvVideo)

Also, the environment variable $PACPUS_ROOT must point to the pacpus installation directory (you normally already set it when you installed PACPUS).

Then we need to configure the installation :

$ export PACPUS_ROOT=/opt/pacpus/0.2.3 # Pacpus Framework path
$ cd trunk/build/ # first go into the build folder
$ cmake ..

Now we can compile and install :

$ sudo make install

Make sure the executable files you just created are copied into $PACPUS_ROOT/lib/.

We can also use build_linux.sh to compile

$ cd trunk/build/ # first go into the build folder
$ ./build_linux.sh

Execution

In order to work with the plugins we want, PACPUS needs an XML file.

XML configuration

<?xml version="1.0" encoding="ISO-8859-1"?>
<pacpus>
        <components>
                <component name="webcam" 
                        type="CVWebcam" 
                        device="0" 
                        width="640" 
                        height="480" 
                        framerate="25" 
                        ui="true"                               
                        recording="true" />
        </components>

        <connections></connections>

        <plugins prefix="lib" postfix="" extension="so">
                <plugin lib="OpencvVideo" />
        </plugins>
</pacpus>

Running the plugin

Please verify that you have a working pacpus installation on your system: refer to the GettingStarted page.

Testing under Linux

Run the pacpus plugin with this command:

cd $PACPUS_ROOT
./PacpusSensor OpencvVideo.xml 

Remark: you can check that the USB camera is well known by linux with lsusb

$ lsusb 
Bus 002 Device 004: ID 099a:7202 Zippy Technology Corp. 
Bus 002 Device 003: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 1546:01a8 U-Blox AG 
Bus 003 Device 008: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye
Bus 003 Device 002: ID 09d7:0100 Novatel Wireless NovAtel FlexPack GPS receiver
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

We can see here the Sony Playstation Eye camera detected on USB.

Testing under Windows

TODO

Last modified 9 years ago Last modified on May 13, 2016, 5:44:09 PM
Note: See TracWiki for help on using the wiki.