JeVois  1.10
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Compiling JeVoisBase software from source

JeVoisBase vision software is in a repository called jevoisbase and located at https://github.com/jevois

It provides a base collection of 25+ machine vision modules. Those are the modules that are bundled with the JeVois smart camera by default. They provide a wide range of machine vision algorithms, including visual attention and gist of a scene, object recognition, QRcode decoding, object tracking, road following, etc.

Compiling JeVoisBase software from source is only supported on Ubuntu Linux (version 16.10 amd64 recommended).

Before you attempt to compile JeVoisBase, you should go through the INSTALL instructions at least once. As part of this, you will download all JeVoisBase software and all necessary Ubuntu packages.

Theory

The JeVoisBase core software is written in C++-17. It uses the facilities provided by the JeVois core software, and implements machine vision modules that can run on the JeVois smart camera.

The JeVoisBase software is configured and compiled using CMake, like the JeVois software.

Like the core JeVois software, it can be compiled natively on your Linux computer (host mode), in which case video will be captured from any connected camera, and video output will be to your computer's display. It can also be cross-compiled for the CPU inside the JeVois smart camera (platform mode), in which case video will be captured from the video sensor inside the JeVois camera, and video output will be streamed over the USB link.

Because several machine vision modules in JeVoisBase use the same components, such as for example a visual attention component, JeVoisBase is architectured as:

  • libjevoisbase.so contains all the components, i.e., elementary machine vision algorithms
  • Modules then simply connect a collection of those components together, to the camera input, and to the video streaming output over USB.

Getting the source code from GitHub

cd
git clone https://github.com/jevois/jevoisbase.git

Before compiling for the first time: Getting the contributed packages

The directory jevoisbase/Contrib is for a collection of contributed source code packages.

Before you attempt to compile jevoisbase the first time, you should download and patch those contributed packages, as follows:

cd jevoisbase/Contrib
./reinstall.sh

Full reconfiguration and compilation

Scripts are provided to recompile everything:

  • rebuild-host.sh will
    • Compile natively for your computer's CPU
    • Object files will be in hbuild/ which the script creates
    • Modules and libraries will be installed in /jevois (to match their location on the platform hardware)
    • Thus, modules are ready to use immediately on your computer.
  • rebuild-platform.sh will
    • Cross-compile for the CPU inside the JeVois smart camera (arm-gnueabi-hf)
    • Object files will be in pbuild/ which the script creates
    • if you specify ./rebuild-platform.sh --staging
      • Modules, config files, etc will be installed to staging directory /var/lib/jevois-microsd/ (see Organization of JeVois files on host and platform)
      • Thus, because all target files are stored into the staging area, they will be ready to be flashed to microSD that can then be inserted into your JeVois smart camera.
    • if you specify ./rebuild-platform.sh --microsd
      • Modules, config files, etc will be installed to a live microSD card (either inserted into your host computer using a microSD-to-USB adapter, or exported live by JeVois using the usbsd command in the JeVois command-line interface) that must be be available under /media/username/JEVOIS/ where username is your Linux user name.
      • Thus, all target files are directly copied to microSD for immediate use.
    • if you specify ./rebuild-platform.sh --live (with JeVois v1.3 or later):
      • Note that this is not recommended for jevoisbase given its size, but is the easiest way to install new single modules to a microSD.
      • Just connect JeVois and allow it to boot up.
      • Modules will be cross-compiled
      • JeVois will be instructed to export its microSD as a virtual flash drive (the build script will run host command jevois-usbsd start)
      • Modules, config files, etc will be installed to the live microSD card inside JeVois
      • Thus, all target files are directly copied to microSD for immediate use.
      • JeVois will be instructed to stop exporting its microSD as a virtual flash drive and to restart (the build script will run host command jevois-usbsd stop)
    • Otherwise, if you just run ./rebuild-platform.sh, libraries and modules will be installed into the jvpkg directory in jevoisbase
      • To pack those files, cd to pbuild and type 'make jvpkg', which will create jevoisbase/JeVois_jevoisbase.jvpkg
      • You can then drop this into the packages/ directory of a JeVois microSD to install the package next time you start your JeVois smart camera. See Programmer SDK and writing new modules for more info.
Note
Once you select a destination in rebuild-platform.sh (none, staging, microsd, or live), that will remain for subsequent make install commands, until you change it by re-running rebuild-platform.sh with another destination.

Once jevoisbase is compiled and installed for host, you can try it out using The jevois-daemon executable.

Partial re-compilation

The scripts rebuild-host.sh and rebuild-platform.sh clear and recompile everything.

You should run them at least once.

Then, if you are just changing a few files, you can only recompile what is needed, as follows:

  • for host:
    cd hbuild
    make -j 4    # replace 4 by the number of cores on your desktop computer
    sudo make install
    make doc     # if desired
    
  • for platform:
    cd pbuild
    make -j 4    # replace 4 by the number of cores on your desktop computer
    make install # if desired
    make jvpkg   # if desired and if you did not specify -DJEVOIS_MODULES_TO_BUILDROOT=ON when running rebuild-platform.sh