JeVois Tutorials  1.6
JeVois Smart Embedded Machine Vision Tutorials
Share this page:
Changing machine vision parameters

By connecting to the serial command-line interface of JeVois, you can issue commands (either interactively, or through a program) to modify how the machine vision algorithm currently running inside JeVois works.

Here we will take the simple example of looking for different kinds of barcodes in the field of view of JeVois.

UserParametersQR.png

This tutorial requires a JeVois v1.1 or later microSD card.

Pre-requisites

You need to know how to stream video from JeVois, how to change video mode, and how to communicate with the serial command-line interface of JeVois.

Getting started

Listing the available parameters

The DemoQRcode module exposes several parameters that are described in its documentation page, see the table of parameters below the screenshots on that page.

Once the module is loaded and running (by selecting the appropriate video resolution in the host video capture software), you can also see the parameters by typing, in the serial terminal connected to JeVois:

help

which lists all available parameters and commands; here, in particular, we find 3 parameters that are specific to the QR code decoding module:

QRcode/Barcode Options:
  --ydensity (int) default=[1]
    Scanner horizontal scan density (pixel stride), or 0 to disable
       Exported By: DemoQRcode:qrcode

  --xdensity (int) default=[1]
    Scanner vertical scan density (pixel stride), or 0 to disable
       Exported By: DemoQRcode:qrcode

  --symbol (string) default=[ALL]
    Type(s) of QR code / barcode symbols searched for, multiple entries are possible and should be separated by / characters. Selecting many symbol types or ALL will slow down processing. Supported symbols are: QRCODE, EAN2, EAN5, EAN8, EAN13, UPCE, UPCA, ISBN10, ISBN13, COMPOSITE, I25, DATABAR, DATABAREXP, CODABAR, CODE39, PDF417, CODE93, and CODE128
       Exported By: DemoQRcode:qrcode value=[QRCODE]

Changing a parameter

Looking at the last line of the entry for symbol above, we see that the symbol parameter was set to value QRCODE; that is, the module is looking for 2-dimensional Quick-Response codes of the type shown in the module's documentation page.

Let's change that to ALL to decode all kinds of 1D barcodes as well, for example the ISBN barcode on a book:

setpar symbol ALL

which should simply return

OK

We can verify that the change took place in three ways:

UserParametersAll.png

Setting default parameters

Once you have played with parameters interactively, you may want to set some default values each time a given module is loaded. This is possible in JeVois through two configuration files, which are located in the directory of the module of interest (if the files are absent, then no action is taken by the module):

For example, the default params.cfg for the DemoQRcode module is located in JEVOIS:/modules/JeVois/DemoQRcode/params.cfg on the MicroSD card and contains:

# Default parameters that are set upon loading the module

# Only look for QR codes by default, faster than looking for any kind of barcode and qr-code:
qrcode:symbol = QRCODE

The effect is that, by default, we only scan for 2D QR-codes.

The equivalent script.cfg would be in JEVOIS:/modules/JeVois/DemoQRcode/script.cfg and would contain:

setpar qrcode:symbol QRCODE

For more information about params.cfg and script.cfg, see Programmer SDK and writing new modules.