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:

  1. Downloading Camport3 SDK

  2. Installing USB driver

  3. Installing dependencies

  4. Compiling sample programs

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:

Camport3 SDK目录结构

Camport3 SDK directory Structure

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

  1. 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:

    未识别 USB 设备

    Unrecognized USB device

  2. 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.

    Camport3设备驱动

    Camport3 device driver

After successful installation of the driver, you can find the Percipio Device in the Device Manager.

Percipio Device 设备

Percipio Device

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

  1. Camport SDK requires users to install OpenCV 2.4.8 or higher versions.

  2. 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:

  1. Install Visual Studio.

  2. 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:

  1. Create a directory named build in the SDK sample directory.

  2. Start cmake-gui.

  3. Specify the source code directory as sample and the output directory for compilation as sample/build.

    wincompilestep2
  4. Click on Configure, select your version of Visual Studio, and click on Finish.

    wincompilestep2
  5. Specify the file path in the OpenCV_DIR column as opencv/build.

    wincompilestep3
  6. 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.

    wincompilestep5
  7. Click on Generate.

    wincompilestep4
  8. Click on Open Project to open the project.

    wincompilestep6

Note

Afterwards, the project can be opened with the Project.sln or ALL_BUILD.vcxproj file in the camport3/sample/build path.

  1. Build Project: In the Visual Studio menu bar, click on Build> Build Solution.

    wincompilestep7

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.