JeVois  1.20
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 20.04 amd64.

Before you attempt to compile JeVoisBase, you should compile jevois for both host and platform as explained in Compiling JeVois core software from source

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 on JeVois-A33 or libjevoisprobase.so on JeVois-Pro 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 or HDMI.

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

Note
The compilation scripts now do this automatically.

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

JeVois-A33: 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.

JeVois-Pro: Full reconfiguration and compilation

Scripts are provided to recompile everything:

  • rebuild-pro-host.sh will
    • Compile natively for your computer's CPU
    • Object files will be in phbuild/ which the script creates
    • Modules and libraries will be installed in /jevoispro (to match their location on the platform hardware)
    • Thus, modules are ready to use immediately on your computer.
  • rebuild-pro-platform.sh will
    • Cross-compile for the ARM CPU inside the JeVois-Pro smart camera
    • Object files will be in ppbuild/ which the script creates
    • Config files used by JeVois at runtime will be staged into /var/lib/jevoispro-microsd/config/
    • Executables including jevois-daemon will be staged into /var/lib/jevoispro-build/usr/bin/
    • Include files will be staged into /var/lib/jevoispro-build/usr/include/jevois/
    • The core JeVois Base library (libjevoisprobase.so) will be staged into /var/lib/jevoispro-build/usr/lib/
    • Documentation files are staged into /var/lib/jevoispro-build/usr/share/doc/jevoispro-platform/
    • Thus, because all target files are stored into the staging area, they will be ready to be used as dependencies when you try to compile new custom machine vision modules.
  • rebuild-pro-platform-pdeb.sh will
    • Cross-compile for the ARM CPU inside the JeVois-Pro smart camera
    • Object files will be in ppdbuild/ which the script creates
    • A deb package will be created that should be installed on the camera while logged on the camera.
    • File locations are the same as above for host.

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

Here is a walkthrough of what you should see when compiling jevois and jevoisbase from source for JeVois-Pro:

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:

  • JeVois-A33: for host
    cd hbuild
    make -j
    sudo make install
    make doc     # optional; if desired
    
  • JeVois-A33: for platform
    cd pbuild
    make -j
    sudo make install
    make jvpkg   # if desired
    
  • JeVois-Pro: for host
    cd phbuild
    make -j
    sudo make install
    make doc     # optional; if desired
    
  • JeVois-Pro: for platform support files
    cd ppbuild
    make -j
    sudo make install
    
  • JeVois-Pro: for platform deb
    cd ppdbuild
    make -j
    sudo make install
    sudo cpack # will re-generate the deb package into ppdbuild/jevoisprobase-platform_XXX_arm64.deb
    # You can then copy this file to microSD, switch JeVois-Pro to console boot, then
    # `apt remove jevoisprobase-platform` to nuke the existing version and then `dpkg -i <your_new_deb>`.