Install with Zip Package
- Extract the lpv_sdk_x.x.x.x.zip file to any directory.
- [Optional] 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(https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0), or our link.
- You should then manually register the LPV dlls.
Manual Registration
- RMC the reg_run_as_admin.bat file under the root runner 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 under the root runner folder, it will print out the path of all well-registered LPV modules.
Use the 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.
Licensing
Full Version: Use 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: Use 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.
- 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:
- Put the license file under the root runner folder(./runner).
- Put the license file under the user folder(AppData%/LPV).
- 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
Add LPV Libraries to Visual Studio Projects
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.
- In your code, add the line
using LPVXXXLib;
to start using the LPV classes.
The following code show a short example:
LMatch m_lmatch = new LMatch();
m_lmatch.MaxCount = 1;
m_lmatch.AngleTolerance = 180;
LPVErrorCode errCode = m_lmatch.Match(m_source_img, (LRegion)m_roi, out m_match_results);
LPV Core Library, provide basic functionalities.
Definition: LPVCore.idl:103
LPVErrorCode
This enumeration represents the type of a LPV function error.
Definition: LPVCore.idl:206
LPV Geometry Library, provide geometric functionalities.
Definition: LPVGeom.idl:50
LPV Pattern Library, provides functionality for pattern matching.
Definition: LPVPat.idl:50
C++
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: -or-
#import "Y:\\runner\\x86\\lpvCore.dll"
-or-
#import "progid:LPV.LImage"
-or-
#import "libid:c34b3e9e-6dea-4aa9-b500-0266f90dc15f"
- Start using the LPV classes.
The following code show a short example:
#include "LPVCore.h"
#include "LPVGeom.h"
#include "LPVPat.h"
ILMatchPtr m_lmatch(__uuidof(LMatch));
m_lmatch->MaxCount = 1;
m_lmatch->AngleTolerance = 180;
LPVErrorCode errCode = m_lmatch->Match(m_source_img, m_roi, &m_match_results);
if (errCode != LPVErrorCode::LPVNoError) {
}
Alternatively for Qt applications, you could use Active Qt to generate QAxObject wrappers for LPV classes, please follow the QT's official guide.