Prerequesite

Setup

You should have first installed SolAR binaries, please refer to the binaries part. This will also provide you with the sample codes.

Please check your SolAR directory :

solar directory

The "Samples" directory contains two sample programs. These programs demonstrate how to use SolAR framework and an opencv-based Module to perform a simple camera pose estimation. One is based on a natural image marker, the other one is based on a fiducial marker.

The following is dedicated to the use of Qt. Yet Visual Studio 2017 solutions and projects are also provided : just open solutions (.sln), build and run : everything is pre-configured.

Install your C++ IDE for windows

Please refer to "the getting started with windows" part of the website link: here

Sample project configuration

Please choose the sample code you are interested in and open the corresponding directory.

Then open the project .pro file with QT creator.

Compile

Please click on "run qmake" : it will configure the compilation with your config parameters that were set during the SolAR binaries set-up.

run samples

Then click on "build" and check that the sample code is correctly compiled.

run samples

Natural Marker samples : run it

The current sample folder contains all necessary files to run the executable code. So configure the working directory to be the current sample folder by selecting Build and Run / Run menu. For instance, for the Natural Image Marker sample, please select your "…​/Samples/NaturalImageMarker" directory.

run samples

You have to set the input parameters required by the sample code to run as expected, please refer to the readme.adoc file

example :

grafMarker.yml camera_calibration.yml 0

This is an example of Natural Image Marker based homography estimation using SolAR Framework. To use it, you can print the Natural Image "graf1.png" present in the current directory or you can display it on your computer screen. Then be sure that the scene captured with your camera includes this target image, as illustrated below.

run samples

If it runs as expected, a square box should be drawn on the marker.

Fiducial Marker samples : run it

The current sample folder contains all necessary files to run the executable code. So configure the working directory to be the current sample folder by selecting Build and Run / Run menu. For instance, for the Fiducial Marker sample, please select your "…​/Samples/FiducialMarker" directory.

You have to set the input parameters required by the sample code to run as expected, please refer to the readme.adoc file

run samples

example :

fiducialMarker.yml camera_calibration.yml 0

To use it, you can print the fiducial marker Image "FiducialMarker.gif" present in the current directory or you can display it on your computer screen. Then be sure that the scene captured with your camera includes this target image, as illustrated below.

run samples

If it runs as expected, a square box should be drawn on the marker.

Frequently Asked Questions

  1. When I compile the sample code, I obtain the error "error: C2039: 'TOOLS': is not a member of 'SolAR::MODULES'": what is the problem?

    It probably means that your SolAR binaries are not up-to-date, try to close QT, and re install SolAR see the binaries part.

  2. When I compile the sample code, I obtain the error

    "SolARCameraOpencv.h" does not exist. This is probably due to a environment parameter problem. Please close and re open QT, and retry. Check your SolAR directory, as advised in this section.

  3. When I compile the sample code, I have the error "IComponentManager.h" does not exist: what should I do

    pkgconfig is probably missing on your computer. Please retry to setup SolAR, and take care about pkgconfig.

  4. When I run the sample code, I see "File readme.adoc does not exist", what does it mean?

    It means your working directory for this sample is not configured properly. See the "sample configuration" sub section.

  5. When I run the sample code, I see "missing parameters", what does it mean?

    It means your project run configuration have some missing parameters. The missing parameters are described in the console log, and in the readme.adoc in the sample directory. See the "sample configuration" sub section for details.

  6. I’ve successfully tested the sample codes and decided to further investigate the Solar Framework. Yet, after updating the sample codes via the git hub repository, it turned out that the sample codes don’t compile any longer. What should I do ?

    The Solar binaries (the DLL’s) are likely to be outdated. You are encouraged to proceed to a full update of the whole Solar Framework, including the third parties. Then recompile the bcomBuild binaries : SolarFramework, SolarModuleTools and SolARContainerOpenCV. When I run a dynamic sample code, my program crashes withou explanation. The .ini file must indicate a correct library. If the indicated library does not exist, it crashes. This is a known bug, that will ne soon corrected.

  7. When I run the sample code, the image loading seems to be OK, but the program is crashing

    This is an identified Bug in SolAR, that if an image is missing the component loader does not return an error. Verify the image you try to load is in the working directory.