Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cv_opencvdemo module

This example shows how opencv can be used on (for example) the Bebop drone.

Important to know is that sw/ext/opencv_bebop must be downloaded, and made. After this is done the folder sw/ext/opencv_bebop/install has a opencv.xml file. The LDFLAGS in this file should be the same as in this conf file.

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="cv_opencvdemo">
2  <define name="OPENCVDEMO_CAMERA" value="front_camera|bottom_camera" />
3  <define name="OPENCVDEMO_FPS" value="0" />
4 </module>

Module configuration options

Define Options

  • name: OPENCVDEMO_CAMERA value: front_camera|bottom_camera
    Description: Video device to use
  • name: OPENCVDEMO_FPS value: 0
    Description: The (maximum) frequency to run the calculations at. If zero, it will max out at the camera frame rate

Module functions

Init Functions

These initialization functions are called once on startup.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw cv_opencvdemo.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="cv_opencvdemo" dir="computer_vision">
<doc>
<description>This example shows how opencv can be used on (for example) the Bebop drone.
Important to know is that sw/ext/opencv_bebop must be downloaded, and made.
After this is done the folder sw/ext/opencv_bebop/install has a opencv.xml file.
The LDFLAGS in this file should be the same as in this conf file.
</description>
<define name="OPENCVDEMO_CAMERA" value="front_camera|bottom_camera" description="Video device to use"/>
<define name="OPENCVDEMO_FPS" value="0" description="The (maximum) frequency to run the calculations at. If zero, it will max out at the camera frame rate"/>
</doc>
<header>
<file name="cv_opencvdemo.h"/>
</header>
<init fun="opencvdemo_init()"/>
<makefile target="ap">
<file name="cv_opencvdemo.c"/>
<file name="opencv_example.cpp"/>
<file name="opencv_image_functions.cpp"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_arm/include"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_arm/lib"/>
<flag name="LDFLAGS" value="lopencv_world"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_arm/share/OpenCV/3rdparty/lib"/>
<flag name="LDFLAGS" value="llibprotobuf"/>
<flag name="LDFLAGS" value="llibjpeg-turbo"/>
<flag name="LDFLAGS" value="llibpng"/>
<flag name="LDFLAGS" value="llibtiff"/>
<flag name="LDFLAGS" value="lzlib"/>
<flag name="LDFLAGS" value="lquirc"/>
<flag name="LDFLAGS" value="ltegra_hal"/>
<flag name="LDFLAGS" value="ldl"/>
<flag name="LDFLAGS" value="lm"/>
<flag name="LDFLAGS" value="lpthread"/>
<flag name="LDFLAGS" value="lrt"/>
</makefile>
<makefile target="nps">
<file name="cv_opencvdemo.c"/>
<file name="opencv_example.cpp"/>
<file name="opencv_image_functions.cpp"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_pc/include"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/lib"/>
<flag name="LDFLAGS" value="lopencv_world"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/share/OpenCV/3rdparty/lib"/>
<flag name="LDFLAGS" value="llibprotobuf"/>
<flag name="LDFLAGS" value="lquirc"/>
<flag name="LDFLAGS" value="L/usr/lib/x86_64-linux-gnu"/>
<flag name="LDFLAGS" value="ljpeg"/>
<flag name="LDFLAGS" value="lpng"/>
<flag name="LDFLAGS" value="ltiff"/>
<flag name="LDFLAGS" value="L/usr/lib/x86_64-linux-gnu/hdf5/serial"/>
<flag name="LDFLAGS" value="lhdf5"/>
<flag name="LDFLAGS" value="lpthread"/>
<flag name="LDFLAGS" value="lsz"/>
<flag name="LDFLAGS" value="lz"/>
<flag name="LDFLAGS" value="ldl"/>
<flag name="LDFLAGS" value="lm"/>
<flag name="LDFLAGS" value="lfreetype"/>
<flag name="LDFLAGS" value="lharfbuzz"/>
<flag name="LDFLAGS" value="lrt"/>
</makefile>
</module>