documentation

Building the Windows Examples
Level: Basic

For Windows you can find two examples. We provide a CMakeLists.txt which can be used with CMake to generate the solutions to build the examples. One example requires OpenCV to provide a window for displaying the (debug) video stream. The other example just uses std functions but thus does not provide any visualization.

Requirements

For building the examples, we use CMake and Visual Studio. For the simple example without any visualization there are no additional requirements.

If you want to see the result of the tracking, you also need a version of OpenCV (Core and HighGui). This has been configured with CMake (see step by step tutorial below).

Building the Examples

  1. Download and extract the vlSDK_Package.zip to your development folder.
  2. Use CMake to generate a Visual Studio solution (in this tutorial we use cmake-gui):
    • Open cmake-gui
    • Enter your source and build path and click Configure.
vlSDK_Windows_Example_01_CMakeGUI.png
  • Select the generator for this project according to your build system (we used Visual Studio 15 2017 Win64)
vlSDK_Windows_Example_03_SelectGenerator.png
.
  • After the configuration process has completed, you will probably encounter the error message, that OpenCV could not be found. If you only want to build the simple example with some basic text output, you can ignore this error message. However, if you want to build the second example project that also displays the camera image, you have to install Version 4.1.0 of OpenCV and specify the OpenCV_DIR variable in CMake. Set this variable to the build directory that the OpenCV installer created, which contains the OpenCVConfig.cmake file.
vlSDK_Windows_Example_04_AddOpenCV.png
  • Press Generate and afterwards press Open Project. In the Solution Explorer, you should see the SimpleModelTracker and (if you configured OpenCV correctly) SimpleModelTrackerOpenCV. Right-click on one of the projects and build it.
vlSDK_Windows_Example_05_BuildSolutions.png

Running the Examples

To run the example, you need to specify the .vl file and your license file as command line parameters. You can specify the Command Arguments in the "Debugging" section of the project properties. The first argument should be the path and name of the .vl file. The second argument should be the path and name of the license file. Both arguments should be separated by one space. Arguments containing spaces should be enclosed in quotes. You can use the tracking configuration Files provided with vlSDK_Package.zip in the folder vlSDK/tracker, e.g. vlSDK/tracker/car/car.vl.

vlSDK_Windows_Example_06_AddCommandLineArguments.png

If you build the example with OpenCV and use your own .vl file, it is important, that your tracking configuration contains the parameter

"showLineModel": true 

If this is enabled, you can see the camera image containing the line-model of the object to track (line-model in red: tracking is lost, line-model in green: object is tracked, line-model in yellow: tracking is critical). The provided .vl file already contains this parameter.

vlSDK_Windows_Example_07_TrackingDebugImage.png