Windows platform (Python)

Downloading SDK

Choose any of the following methods to download the MultiLanguage SDK:

  • Download from Percipio.XYZ official website download center: 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 should be stored, and enter the git clone command to clone the remote repository.

    git clone https://github.com/alphaliang/pcammls.git
    

Sample program instructions

The sample programs are stored in the python folder in the root directory of the development package:

  • framefetch.py: This sample program is used to capture depth and color images in free acquisition mode.

  • frame_fetchIR.py: This sample program is used to capture IR images in free acquisition mode.

  • frame_isp.py: This sample program is used to perform ISP post-processing on color images at the software level, converting RAW BAYER images with color cast into color images with standard color space.

  • frame_registration.py: This sample program is used to capture images of RGB-D registration.

  • frame_trigger.py: This sample program is used to set the camera to work in software trigger mode to capture depth maps.

  • multidevice_fetch.py: This sample program is used to set up multiple cameras for image acquisition.

  • point3d_fetch.py: This sample program is used to capture 3D point clouds (not displayed). Log information displays the number of point clouds and the coordinates of the center point cloud (X, Y, Z).

Installing dependencies

Before compiling, please:

  • Install Python.

  • Install NumPy and OpenCV.

    pip install numpy
    pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
    
  • Install SWIG (version 4.0.1 or above).

    Download link: https://www.swig.org/download.html

  • Install CMake (version 3.15.0 or above).

    Download link: https://cmake.org/download/

  • Install Visual Studio.

Compiling sample programs

To compile the sample programs, do the following:

  1. Configure environment variables: Right-click on This PC, select Properties > Advanced system settings > Environment Variables, in the Environment Variables page, add the executable file path of the local SWIG to the system variable Path.

    ../_images/setpathforswig-en.gif
  2. Open the CMakeLists.txt in the pcammls directory, and modify the target language (PYTHON), PYTHON version, and SWIG’s local path in the file as shown in the following figure:

    ../_images/editcmakelistpython.png
  3. Create a new folder in the pcammls directory and name it python_build_x64.

  4. Start cmake-gui, specify the source code directory as pcammls, and specify the build output directory as pcammls/python_build_x64.

    ../_images/specifydirectorypython.png
  5. Click on Configure, select the Visual Studio version and X86/X64 version settings.

    ../_images/clickcongifure_CP.png
  6. Click on Generate.

  7. Click on Open Project to open the project, then select Release in the Visual Studio menu bar and click on Build > Build Solution in order.

    ../_images/pythonmake-en.png

After compilation, copy the generated dynamic libraries pcammls.py and _pcammls.pyd, as well as the tycam.dll, to the pcammls/python directory. Open Windows PowerShell and run the generated python file.

  • pcammls.py: python_build_x64/swig/swig/_output

  • _pcammls.pyd: python_build_x64/swig/Release

  • tycam.dll: camport3/lib/win/hostapp/x64

../_images/pythonrun.png