Loading [MathJax]/extensions/tex2jax.js
Leaper Vision Toolkit
中文 / English
All Data Structures Namespaces Functions Enumerations Enumerator Properties Pages
How to Use DEMO Code Snippets

DEMO code snippets are usually a single C++/C# source code with a main function body, demonstrating how some LPV functions are called. The code snippets files are located under demo/snippets folder.

To compile and run the DEMO code snippets, you should firstly create a Visual Studio project, then add or copy the code snippets file to the project. You may also modify some in the code like the image path to a true accessible path. Then, you may compile and run the project as usual. The algorithms' results are displayed via LDisplay control in the code snippets.

NOTE: The platform of DEMOs should be exactly the same as the LPV dlls you installed and registered.
NOTE: Please make sure the LPV dlls are registered and licensed before running the DEMOs.

Create a New Visual Studio Project

Step 1 - New a Console App Project

Open Visual Studio, click File -> New -> Project in the menu, create the new Console App project as the following.

Step 2 - Add the code snippets to the project

Remove the auto-generated .cpp file in the new project, right click the project and select Add -> Existing Item, browse to the code snippets file and add it to the project.

Alternatively, you may copy and paste the content of the code snippets to the auto-generated .cpp file in the new project.

Add include folder to the project's C++ include confuguration.

Step 3 - Modify the File Paths

Modify the file paths in the code to be accessible, for example:

// load some images, add them to list
ILImagePtr img = LImage::Create();
// change the path, for example, D:/lpv_install_dir/demo/image/sourceImg.png
LPVErrorCode err = img->Load(imgDir + L"sourceImg.png");
if (err != LPVNoError)
return -1; // load image failed
LPVErrorCode
This enumeration represents the type of a LPV function error.
Definition: LPVCore.idl:530