Python (Windows)
Sample Program Overview
The Python sample programs are located at {VCAMERA_SDK_INSTALLATION_PATH}/Percipio_SDK/API/python/python and include:
DepthToColorRegistration.py: Aligns depth images with color images output by the camera.FetchFrame.py: Configures the camera to operate in continuous capture mode and capture depth images.ListDevices.py: Lists all cameras connected to the computer.SoftTrigger.py: Configures the camera to operate in software trigger mode. The camera captures depth images after receiving a software trigger command.version.py: Displays the current SDK version.DumpAllFeatures.py: Lists all features supported by the camera.DumpDeviceInfo.py: Lists camera information.ReadWriteFeatures.py: Lists all readable or writable features supported by the camera.SetIpAddress.py: Sets the camera IP address to static.UserSetSelector.py: Selects a camera user set.LogConfig.py: Configures the dual logging system for both the Vcamera SDK software and the camera hardware.DepthToPointCloud.py: Aligns the depth image and point cloud output by the camera.SaveLoadFeaturesViaFile.py: Saves and loads camera features.
Install Dependencies
Dependency 1 — Python
Note
The recommended Python version is 3.8. Other versions are not tested and the compatibility is not guaranteed.
Download the specified version from the Python Official Website.
Double-click the installer, check the box for “Add Python to PATH”, and click “Install Now”.
Python Installation
Dependency 2 — CMake
Note
The recommended CMake version is 3.25. Other versions are not tested and the compatibility is not guaranteed.
Download the Windows installer from the CMake Official Website.
Double-click the downloaded
.msifile and follow the wizard to complete the installation. Important: Select the option “Add CMake to PATH” during the installation process.
CMake Environment Configuration
Open Command Prompt and execute the following command to validate installation success by checking the version information:
cmake --version
Dependency 3 — Visual Studio
Note
The recommended Visual Studio version is 2022. Other versions are not tested and the compatibility is not guaranteed.
Download and install Visual Studio .
Dependency 4 — OpenCV
pip install opencv-python
Compile Sample Programs
In the directory
{VCAMERA_SDK_INSTALLATION_PATH}/Percipio_SDK/API/python, create a new folder namedbuild.Launch cmake-gui.
Set the source code directory to “python” and the build output directory to “python/build”.
Click the Configure button, select the appropriate Visual Studio version, then click Finish.
Click the Generate button.
Click the Open Project button to open the generated project in Visual Studio.
In Visual Studio, select the “Release x64” configuration from the dropdown menu, then navigate to Build > Build Solution.
Execution
Copy all files from the
Percipio_SDK/API/python/build/Releasedirectory to thePercipio_SDK/API/python/pythondirectory.Copy the dynamic library files (all files except the
.exeexecutables) from thePercipio_SDK/API/cpp/Release/bindirectory to thePercipio_SDK/API/python/python/TyLibrarydirectory.Open a terminal in the
Percipio_SDK/API/python/pythondirectory and run the sample programs.