Requirements
LPV runs on Windows 7 SP1 or later version, either 32-bit or 64-bit. For more details, see Supported Platforms and Minimum System Requirements page.
Install
Using Installer
Download the lpv_x.x.x.x_installer.exe. It's a self-installing archive that includes the LPV binaries and documents. It also helps installing the VC++ Redistributable Package and registering the LPV dlls.
Using Zip Package
Download then extract the lpv_sdk_x.x.x.x.zip file to any directory. Then, manually register the LPV dlls.
Note: If you don't have Visual C++ Redistributable Package 14 or higher installed on your machine, you may have to download then install one from Microsoft's official website, or our link.
Manual Registration
- RMC the reg_run_as_admin.bat file under bin folder, click Run as administrator. It will then register all licensed LPV modules of all platforms(both x86 and x64).
- Double click to run the check_lpv_module_path.bat file, it will print out the paths of all well-registered LPV modules.
Licensing
Full Version: Dongle
- For Sense dongle, download then install the driver software from the official site or our download link here.
- Plug in the dongle of LPV. Make sure the key lights up.
- Open lpvAssistant application under the installed folder or from the start menu shortcut.
- In Dongles group, switch to View Licenses panel, review license status of all modules.
Trial Version: License File
Note: This approach is only for short-term evaluation, you'll be notified when the trial period expired, please contact us or your LPV SDK Tech Support for more help.
- Open lpvAssistant application under the installed folder or from the start menu shortcut.
- In Licenses Files group, switch to Activate Licenses panel then click Generate Key File button. It generates a lpv.key file under your selected directory.
- Send the generated lpv.key file to us or your LPV SDK Tech Support. We will send you back a .lic license file.
- Click Activate button in the same panel and choose the correct license file.
- The assistant will test the licenses and pop up "Successfully licensed!" message box if everything works fine.
- You may review license status of all modules in View Licenses panel.
Legacy
- Run lpvKeyTool.exe under the installed folder. It generates a lpv.key file on your desktop.
- Send the generated lpv.key file to us or your LPV SDK Tech Support. We will send you back a .lic license file.
- You may use any of the following approach to deploy the license file:
- Place the license file into bin folder.
- Place the license file into %AppData%/LPV/ folder.
- Open any demo application, it will pop up the unlicensed warning dialog, click RETRY and upload the license file, we will copy it for you to the right folder.
Integration
On Windows, LPV provides C++/COM/C# interfaces.
Integrated with LPV
C++
In your C++ code, add #include "LPVXXX.h"
to include the required LPV modules, then create LPV instances via static LClass::Create()
functions.
The following code show a short example:
#include "LPVCore.h";
#include "LPVGeom.h";
#include "LPVPat.h";
ILMatchPtr lmatch = LMatch::Create();
lmatch->MaxCount = 1;
lmatch->AngleTolerance = 180;
LPVErrorCode errCode = lmatch->Match(sourceImg, roi, out matchResults);
if (errCode != LPVErrorCode::LPVNoError) {}
LPV Core Library, provide basic functionalities.
Definition: LPVCore.idl:427
LPVErrorCode
This enumeration represents the type of a LPV function error.
Definition: LPVCore.idl:530
LPV Geometry Library, provide geometric functionalities.
Definition: LPVGeom.idl:80
LPV Pattern Library, provides functionality for pattern matching.
Definition: LPVPat.idl:80
C#
In your C# code, add using LPVXXXLib;
to import the required LPV modules, then create LPV instances by new LClass()
.
The following code show a short example:
LMatch lmatch = new LMatch();
lmatch.MaxCount = 1;
lmatch.AngleTolerance = 180;
LPVErrorCode errCode = lmatch.Match(sourceImg, (LRegion)roi, out matchResults);
COM
It's recommended to use Compiler COM Support to directly read LPV modules out and convert it to C++ headers. Then you can use the COM interfaces as classes.
- Call CoInitializeEx when your program starts and CoUnitialize when it terminates. If you create and host LPV classes in threads, you should also call the two functions when the thread start and finish its job. You should do it before create and initialize LPV classes. For example, for a MFC application, the best place to do this is in InitInstance and ExitInstance, as following:
BOOL CMFCApp::InitInstance()
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
CWinApp::InitInstance();
}
INT CMFCApp::ExitInstance()
{
CoUninitialize();
return CWinApp::ExitInstance();
}
Note: For Qt applications which uses QApplication or QGuiApplication, you may omit the CoInitializeEx call since they will initialize COM as STA in their constructor. But for QCoreApplication, it's still required.
- Use #import directive to incorporate information from LPV libraries, including LPVCoreLib (must-have), LPVGeomLib (must-have) and other required LPVXXXLibs.
For example, to import LPVCore library:
#define LPV_COM
#include "LPVCore.h"
-or-
#import "Y:\\bin\\x86\\lpvCore.dll"
-or-
#import "progid:LPV.LImage"
-or-
#import "libid:c34b3e9e-6dea-4aa9-b500-0266f90dc15f"
- The following code show a short example that using the prepared include file in LPV:
#define LPV_COM
#include "LPVCore.h"
#include "LPVGeom.h"
#include "LPVPat.h"
ILMatchPtr lmatch(__uuidof(LMatch));
lmatch->MaxCount = 1;
lmatch->AngleTolerance = 180;
LPVErrorCode errCode = lmatch->Match(sourceImg, roi, &matchResults);
if (errCode != LPVErrorCode::LPVNoError) {
}
Add LPV Libraries to Visual Studio Projects
C++
- RMC your C++ project, open project's Property panel.
- Under C/C++ -> General -> Additional Include Directories, add path to LPV include folder.
- Under Link -> General -> Additional Library Directories, add path to LPV lib folder.
- In your code, add the line
#include "LPVXXX.h"
to start using the LPV classes.
The following code show a short example:
C#
- RMC your C# project, click Add -> Reference.
- Under COM -> Type Libraries panel, search and find LPVCoreLib (must-have), LPVGeomLib (must-have) and other LPVXXXLibs according to your application, then click OK to add reference (and Interop) to them in your project.
COM
- RMC your C++ project, open project's Property panel.
- Under C/C++ -> General -> Additional Include Directories, add path to LPV include folder.
- Under C/C++ -> Preprocessor -> Preprocessor Definitions, add
LPV_COM
.
- Add
#include "LPVXXX.h"
for the require modules.
Add LPV Libraries to CMake Projects
C++
Edit CMakeList.txt, add include path and link libraries.
# set C++ starndard to at least cpp11
set(CMAKE_CXX_STANDARD 11)
# add include path
# ${LPV_INCLUDE_PATH} points to include folder
target_include_directories(${PROJECT_NAME} ${LPV_INCLUDE_PATH})
# link lpv module
# ${LPV_LIB_PATH} points to lib folder
function(link_lpv_lib module_name)
find_library(LPV_LIBRARY_${module_name} NAMES ${module_name} PATHS ${LPV_LIB_PATH})
if(NOT LPV_LIBRARY_${module_name})
message("!!!! LPV_LIBRARY_${module_name} not found")
else()
target_link_libraries(${PROJECT_NAME} ${LPV_LIBRARY_${module_name}})
endif()
endfunction()
link_lpv_lib(lpvCore)
link_lpv_lib(lpvGeom)
link_lpv_lib(lpvPat)
C#
COM
Edit CMakeList.txt, add include path and COM preprocessor.
# enable COM interface
add_compile_definitions(LPV_COM)
# add include path
# ${LPV_INCLUDE_PATH} points to include folder
target_include_directories(${PROJECT_NAME} ${LPV_INCLUDE_PATH})
Add LPV Libraries to Qt Projects
C++
If you are using Qt Creator,
- RMC your project, select Add Library.
- Choose External library, then click Next.
- Browse Library file to LPV dynamic libraries under lib folder.
- Browse Include path to LPV include folder.
- Check Windows platform and Dynamic linkage, uncheck Add "d" suffix for debug version.
- Click Next and then Finish.
Alternatively, you can edit .pro file manually as the following:
# add include path
# ${LPV_INCLUDE_PATH} points to include folder
INCLUDEPATH += $$LPV_INCLUDE_PATH
# link lpv module
# ${LPV_LIB_PATH} points to lib folder
LIBS += -L$$LPV_LIB_PATH -llpvCore -llpvGeom -llpvPat
DEPENDPATH += $$LPV_LIB_PATH
C#
COM
Edit .pro file manually as the following:
# enable COM interface
DEFINES += LPV_COM
# add include path
# ${LPV_INCLUDE_PATH} points to include folder
INCLUDEPATH += $$LPV_INCLUDE_PATH