First Steps with eVision

First Steps In C++

The only requirement to use eVision in C++ is to include the headers. Those headers form a header-only C++ library that is able to load the eVision DLL.

The location of those headers depends on the platform:

  • On Windows, they are located in C:\Program Files\Allied Vision\eVision 26.10\Include

  • On Linux, they are located in /opt/alliedvision/eVision_26_10/include

No linker settings are required when using the C++ version of eVision.

Header Inclusion

Using Library-Focused Headers

It is also possible to include all the types of a given library within *eVision.

These headers are:

  • Easy.h

  • Easy3D.h

  • EasyBarCode.h

  • EasyColor.h

  • EasyDeepLearning.h

  • EasyFind.h

  • EasyGauge.h

  • EasyImage.h

  • EasyMatch.h

  • EasyMatrixCode.h

  • EasyObject.h

  • EasyOcr.h

  • EasyOcv.h

  • EasyQRCode.h

Just use, as example, #include <Easy.h> to get access to all the types in the Easy library.

Configuring the Compiler

On Windows

Hint

It is recommended to use Microsoft Visual C++.

The headers of eVision have a lot of content, and it is highly recommended:

  • To include the headers into a precompiled header to avoid unnecessarily recompilations.

  • When using Visual C++:

    • to use the following settings to avoid compilation issues:

      • /bigobj: allows the compiler to handle more code in the headers.

      • /zm256 (or bigger): allows bigger precompiled headers.

    • To disable Browse Information, as it is superseded by Intellisense and it is known to crash when handling big projects.

On Linux

Hint

It is recommended to use the latest version of GCC available for the current Linux distribution.

C++ Library Initialization and Termination

The C++ version of eVision requires a library initialization and termination process.

There are two possible modes for this initialization:

  1. Automatic: the library is automatically initialized when it is used for the first time and automatically terminated at the end of the process. This is the default mode.

  2. Manual: no automatic behavior occurs and the initialization and the termination must be done manually.

While the default automatic mode is suitable for most use cases, there are some specific cases where it is not fully functional, especially when is used inside a shared library. In these cases it is recommended to switch to the manual initialization and termination mode.

To perform the manual initialization and termination, use the following methods:

using namespace eVision;
// at start
Preconfiguration::SetInitializationMode(EInitializationMode_Manual);
Preconfiguration::Initialize();
// at end
Preconfiguration::Terminate();

First Steps in .NET

Warning

The .NET version of eVision is available on Windows only.

To use eVision with .NET:

  • Add a reference to the eVision_NetApi.dll file to your project in your development environment.

    That file is located in:

    C:\Program Files\Allied Vision\eVision 26.10\Bin\eVision_NetApi.dll

    Note

    You do not need to copy any other DLL.

  • Declare the usage of eVision at the top of your source code files:

    using eVision;
    

First Steps in Python

Installing Python

Python 3.11 or later is required to use the Python bindings for eVision.

Note

No other third party dependencies are necessary to use the Python bindings.

On Windows

The recommended way is to install Python is to download an installer from the official Python website:

https://www.python.org/

On Linux (Ubuntu/Debian example)

Tip

You can check your current Python version using python3 --version.

If your default Python version is >= 3.11 (Ubuntu >= 23.04 and Debian >= 12):

  • That version of Python is sufficient to use the Python Bindings for eVision.

  • You can ensure all necessary packages are installed with:

    sudo apt-get install python3 python3-venv
    

If your default Python version is < 3.11 (Ubuntu <= 22.10):

  • The default installed version of Python is not sufficient.

  • You can install another version using uv

  • Example:

    # ensure curl is installed
    sudo apt-get update
    sudo apt-get install curl ca-certificates
    # install uv
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source $HOME/.local/bin/env
    # install python 3.13
    uv python install 3.13 --default # python 3.11 minimum
    

    Then the python3 --version command should display the version you installed.

Installing the Python Bindings

Note

While the direct installation of pip dependencies outside a venv is always possible and is fully supported by the eVision Python bindings, most recent Linux distributions forbid direct installation of those dependencies by default. As such, this guide exclusively recommends using a venv.

First initialize a venv using:

python3 -m venv ./venv

Then load it in the current CLI environment (must be done at each restart of the shell):

# linux bash
source ./venv/bin/activate
# windows Powershell
.\venv\Scripts\Activate.ps1
# windows git bash
source ./venv/Scripts/activate

To install the Python binding you must then type a pip install command.

  • On Windows, the command is:

    pip install "C:\Program Files\Allied Vision\eVision 26.10\Python\ evision-26.10.0-beta.2.dev-PLATFORM.whl"
    
  • On Linux, the command is:

    pip install /opt/alliedvision/eVision_26_10/Python/evision-26.10.0-beta.2.dev-PLATFORM.whl
    

The Python Bindings for eVision are installed in your venv. As example you can test it interactively using:

python3

Then:

import eVision
help(eVision)

Usage

In any Python environment where the Python bindings are properly installed, just use:

import eVision

The various components of eVision are available directly under the eVision Python package. As example:

import eVision
point = eVision.EPoint(10, 10)

If you are using a Python IDE, all the eVision API support auto-completion with type information and documentation.

Hint

The recommended IDE is Visual Studio Code with the extensions that are automatically recommended by the editor when opening a .py file.

Using the Sample Programs

The sample programs for the Python bindings for are available in <evision_samples_folder>/Sample Programs/Python samples

Please note that most samples have Python dependencies aside from evision in requirements.txt files.

To install those dependencies use the following command:

pip install –r ./requirements.txt