Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
cv_qrcode module

QR code reader using ZBAR library

A telemetry message with the code content is sent when a QR code is detected when qrscan is called.

Example for airframe file

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

<module name="cv_qrcode">
b'<define name="QRCODE_CAMERA" value="front_camera|bottom_camera" />\n '
b'<define name="QRCODE_FPS" value="0" />\n '
b'<define name="QRCODE_DRAW_RECTANGLE" value="TRUE|FALSE" />\n '
</module>

Module configuration options

Define Options

  • name: QRCODE_CAMERA value: front_camera|bottom_camera
    Description: The V4L2 camera device that is used for searching a QR code
  • name: QRCODE_FPS value: 0
    Description: The (maximum) frequency to run the calculations at. If zero, it will max out at the camera frame rate
  • name: QRCODE_DRAW_RECTANGLE value: TRUE|FALSE
    Description: Whether or not to draw a rectangle around a found QR code

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

  • modules/computer_vision/qrcode/qr_code.c
  • /zbar/qrcode/bch15_5.c
  • /zbar/qrcode/binarize.c
  • /zbar/qrcode/isaac.c
  • /zbar/qrcode/qrdec.c
  • /zbar/qrcode/qrdectxt.c
  • /zbar/qrcode/rs.c
  • /zbar/qrcode/util.c
  • /zbar/decoder/qr_finder.c
  • /zbar/decoder/ean.c
  • /zbar/error.c
  • /zbar/image.c
  • /zbar/scanner.c
  • /zbar/symbol.c
  • /zbar/refcnt.c
  • /zbar/decoder.c
  • /zbar/img_scanner.c

Raw cv_qrcode.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="cv_qrcode" dir="computer_vision/qrcode">
<doc>
<description>
QR code reader using ZBAR library
A telemetry message with the code content is sent when a QR code is detected when qrscan is called.
</description>
<define name="QRCODE_CAMERA" value="front_camera|bottom_camera" description="The V4L2 camera device that is used for searching a QR code"/>
<define name="QRCODE_FPS" value="0" description="The (maximum) frequency to run the calculations at. If zero, it will max out at the camera frame rate"/>
<define name="QRCODE_DRAW_RECTANGLE" value="TRUE|FALSE" description="Whether or not to draw a rectangle around a found QR code"/>
</doc>
<dep>
<depends>video_thread</depends>
</dep>
<header>
<file name="qr_code.h"/>
</header>
<init fun="qrcode_init()"/>
<makefile target="ap">
<file name="qr_code.c"/>
<!-- zbar -->
<configure name="EXTSW" value="$(PAPARAZZI_SRC)/sw/ext" />
<configure name="LIBZBAR" value="$(EXTSW)/libzbar/zbar-0.10" />
<file name="bch15_5.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="binarize.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="isaac.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="qrdec.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="qrdectxt.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="rs.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="util.c" dir="$(LIBZBAR)/zbar/qrcode"/>
<file name="qr_finder.c" dir="$(LIBZBAR)/zbar/decoder"/>
<file name="ean.c" dir="$(LIBZBAR)/zbar/decoder"/>
<file name="error.c" dir="$(LIBZBAR)/zbar"/>
<file name="image.c" dir="$(LIBZBAR)/zbar"/>
<file name="scanner.c" dir="$(LIBZBAR)/zbar"/>
<file name="symbol.c" dir="$(LIBZBAR)/zbar"/>
<file name="refcnt.c" dir="$(LIBZBAR)/zbar"/>
<file name="decoder.c" dir="$(LIBZBAR)/zbar"/>
<file name="img_scanner.c" dir="$(LIBZBAR)/zbar"/>
<!-- libexif flags -->
<include name="$(LIBZBAR)/zbar"/>
<include name="$(LIBZBAR)/include"/>
<!--define name="DEBUG_QR_FINDER" value="1"/-->
<flag name="CFLAGS" value="Wno-cast-qual"/>
<flag name="CFLAGS" value="Wno-parentheses"/>
<flag name="CFLAGS" value="Wno-pointer-arith"/>
<flag name="CFLAGS" value="Wno-missing-prototypes"/>
<flag name="CFLAGS" value="Wno-shadow"/>
<flag name="CFLAGS" value="Wno-missing-declarations"/>
</makefile>
</module>