Windows platform (C++)
Windows SDK supports X86 (32-bit) and X64 (64-bit) hardware platforms, and provides driver files for Windows 7 and above operating systems. Windows SDK includes some executable applications (such as viewing depth maps) and sample programs for some applications.
The following is an example of setting up the development environment for Percipio depth camera on Windows platform, using Windows 10 64-bit system:
Downloading Camport3 SDK
Choose any of the following methods to download Camport3 SDK:
Access https://github.com/percipioxyz/ using a browser and download the Camport3 SDK.
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/percipioxyz/camport3.git
The directory structure of Camport3 SDK is shown in the following figure:
Doc directory
It stores the SDK API reference documentation. The documentation is a PDF
file generated by Doxygen and includes descriptive information about classes, structures and interfaces.
include directory
It stores the header files used to call dynamic libraries:
TYImageProc.h
: the header file for the image post-processing function interfaces.TYCoordinateMapper.h
: the header file for mapping of image space transformation.TY_API.h
: the header file for configuring the depth camera and obtaining image data. Users can develop their own applications based on these APIs.
lib/linux directory
It stores library files which support Linux operating system and are compatible with AArch64, ARMv7hf, RaspberryPi, i686 and x86-64 hardware platforms.
lib/win directory
It stores library files which support the Windows operating system and are compatible with x64 and x86 hardware platforms.
sample directory
It stores sample programs for user programming reference. For more information about the sample programs, please refer to Sample program instructions.
Installing USB driver
After connecting the Percipio depth camera to a Windows PC using a USB cable, right-click on the Start in the bottom left corner of the desktop and click on Device Manager in the Start menu. In Device Manager, an unrecognized USB device
PERCIPIO DEVICEEE
can be found, as shown in the following image:Right-click on the device and select Update driver. Choose the driver from the
lib/win/driver
directory in the Camport3 SDK according to the Windows version of your PC, and follow the system prompts to complete the driver installation.
After successful installation of the driver, you can find the Percipio Device
in the Device Manager.
Installing dependencies
CMake
CMake is a powerful, cross-platform tool tailored for software compilation. It streamlines the build process by enabling developers to define the build procedure in a platform-agnostic way through straightforward statements. CMake is capable of producing a range of makefiles or project files, facilitating the testing of C++ features supported by the compiler, akin to automake in UNIX environments. Notably, CMake’s configuration file is distinctively named CMakeLists.txt. Unlike directly assembling the final software, CMake’s primary role is to generate standardized build files, such as Makefiles for UNIX or projects/workspaces for Windows Visual C++, which are subsequently compiled using alternative tools.
The Camport SDK utilizes CMake to build standard projects. By harnessing the native build systems’ capabilities across different platforms, it can seamlessly adapt to a wide range of platform environments.
Note
Camport SDK requires users to install CMake 2.8.0 or higher versions.
OpenCV
The Camport SDK utilizes the OpenCV image processing library to render depth data transmitted from a Percipio depth camera. Prior to compiling the sample program, ensure the OpenCV image processing software library is installed.
Note
Camport SDK requires users to install OpenCV 2.4.8 or higher versions.
If the target application does not use OpenCV for image display or other image processing calculations, there is no need to install OpenCV.
Compiling sample programs
Before compiling, please:
Install Visual Studio.
Install dependencies.
Note
When installing Visual Studio, you need to select the Visual C++ library module for installation as well, otherwise compilation will not be successful. If you do not know how to install the Visual C++ library, you can contact Percipio technical support.
To compile the sample programs, do the following:
Create a directory named
build
in the SDK sample directory.Start cmake-gui.
Specify the source code directory as sample and the output directory for compilation as
sample/build
.Click on Configure, select your version of Visual Studio, and click on Finish.
Specify the file path in the OpenCV_DIR column as
opencv/build
.Configure the path of the OpenCV library in the system environment variables.
Specific steps: Enter Environment Variables dialog box, select the “Path” column and click on Edit, and configure the path of the OpenCV library in the Edit Environment Variables dialog box.
Click on Generate.
Click on Open Project to open the project.
Note
Afterwards, the project can be opened with the
Project.sln
orALL_BUILD.vcxproj
file in thecamport3/sample/build
path.
Build Project: In the Visual Studio menu bar, click on Build> Build Solution.
Running
After connecting to the PC, the depth camera will start initializing until the Power light on the back of the camera flashes at a frequency of 1Hz. After successful initialization, in the Windows 10 X64 system, you can get the depth map by running the executable file lib/win/hostapp/x64/SimpleView_FetchFrame.exe
in the development package.
Alternatively, you can copy tycam.dll
from the development package lib/win/hostapp/x64
directory to the folder sample/build/bin/Release
generated by the compilation, and run SimpleView_FetchFrame.exe
in the folder to capture the depth map.