Article Directory
1. Installation dependencies:
- Cmake:
Cmake official website download address: https://cmake.org/download/download
and that’s it, double-click to open and install
2. Download swig and SDK:
swig download link: https://www.swig.org/
https://www.swig.org/download.html
Download python SDK
Download from the download center of Percipio official website: https://www.percipio.xyz/downloadcenter/ .
Use the git command to obtain a local copy: open the terminal, switch to the working directory where the SDK needs to be stored, and enter the git clone command to clone the remote warehouse.
git clone https://github.com/alphaliang/pcammls.git
Download the Windows Campport3 SDK
Download from the download center of Percipio official website: https://www.percipio.xyz/downloadcenter/ .
Use the git command to obtain a local copy: open the terminal, switch to the working directory where the SDK needs to be stored, and enter the git clone command to clone the remote warehouse.
git clone
https://github.com/percipioxyz/camport3.git
3. Configure python and swig environment variables
Before compiling, please: install Python. Install NumPy and OpenCV.
pip install numpy
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
Configure Swig environment variables:
Right-click this computer, select Properties > Advanced System Properties > Environment Variables, and add the local SWIG executable file path to the Path of the system variable on the Environment Variables page
four compile
1. Open pcammls and modify cmakelists.txt,
Modify the local path of camport3 in the file, compile the target language (PYTHON) and native PYTHON version, and the local path of SWIG
2. Enable cmake-gui
Specify the source code directory to pcammls, specify the compiled output directory to pcammls/build, click Configure, select the Visual Studio version and X86/X64 version settings, and click Generate.
After clicking Open Project to open the project, select Release in the Visual Studio menu bar and click Generate > Generate Solution
Five, post-compilation test,
Copy the generated dynamic library pcammls.py, _pcammls.pyd and tycam.dll in the camport3 SDK directory to the pcammls/python directory, open Windows PowerShell and run the generated python file.
pcammls.py:python_build_x64/swig/swig/_output
pcammls.lib 和 _pcammls.pyd:python_build_x64/swig/Release
tycam.dll:camport3/bin/win/hostapp/x64
6. Error message repair
1. mkl_inter_thread.1.dll cannot find the specified module
This problem occurs when importing numpy and scipy, both of which can be solved by the following method. Find the corresponding python version in
https://www.lfd.uci.edu/~gohlke/pythonlibs/ and install it.