C++ (Windows Platform)

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. Download Camport3 SDK

  2. Install USB Driver

  3. Install Dependencies

  4. Compile Sample Programs

  5. Run Sample Programs

Download Camport3 SDK

Choose any of the following methods to download Camport3 SDK :

  • Access https://GitHub.com/percipioxyz/camport3.git 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 Directory Structure

Camport3 SDK Directory Structure

Doc Directory

It stores the SDK API reference documentation. The documentation generates Doxygen and includes descriptive information about classes, structures and interfaces.

SDK API Reference Documentation

SDK API Reference Documentation

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 contains two subfolders, sample_v1 and sample_v2, both of which include sample programs for development reference. For more details, see Sample Program Descriptions.

Note

The sample programs in sample_v2 add convenient camera control interfaces on the basis of sample_v1 and provide the option of whether to depend on OpenCV or not.

Install USB Driver

When you are using a USB camera, installing the USB driver is necessary for compiling and running the Camport SDK.

  1. After connecting the Percipio depth camera to a Windows PC using a USB cable, right-click the Start in the bottom left corner of the desktop and click Device Manager in the Start menu. In Device Manager, an unrecognized USB device PERCIPIO DEVICEEE is found, As illustrated in the following image:

    Unrecognized USB Device

    Unrecognized USB Device

  2. Right-click the device and select Update driver. Choose the driver from the lib/win/driver directory in the Camport3 SDK according to the Windows version on your PC, then follow the on-screen instructions to complete the installation.

    Camport3 Device Driver

    Camport3 Device Driver

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

Percipio Device

Percipio Device

Install Dependencies

Install CMake (V3.24.0)

  1. Download Windows installation package from CMake Percipio website .

  2. Double-click the downloaded .msi installer and follow the wizard to complete installation. Important: Select “Add CMake to PATH” during installation so system environment variables are configured automatically.

Cmake-configuration

CMake Environment Configuration

  1. Open Command Prompt and execute the following command to validate installation success by checking the version information:

    cmake --version
    

Install OpenCV (Optional)

  1. Visit the OpenCV Percipio website and download the Windows pre-built library.

  2. Double-click the downloaded .exe file to extract the contents, noting the extraction path.

  3. After extraction, configure the OpenCV library path in the system environment variables.

    Detailed steps: Access the Environment Variables dialog box, select the “Path” entry, and click Edit. In the Edit Environment Variables dialog box, add the OpenCV library path.

    wincompilestep4

    OpenCV Environment Configuration

Note

  1. Camport SDK requires users to install OpenCV 4.5.5. 2. If the target application does not use OpenCV for image display or other image processing calculations, there is no need to install OpenCV.

Install Visual Studio

Download and install Visual Studio . Important: During installation, select the Desktop development with C++ workload under the Desktop and Mobile Applications category.

vs-install

Install Visual Studio

Compile Sample Programs

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

  2. Start cmake-gui.

  3. Set the source directory to sample and the build output directory to sample/build.

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

    wincompilestep2
  5. Select the Sample you need to compile.

  • In OpenCV_DIR, specify the path to opencv/build.

wincompilestep3
  • Select BUILD_SAMPLE_V1.

wincompilestep10
  1. click Generate.

  2. click Open Project to open the project.

    wincompilestep7

    sample_v1 Sample Programs

    wincompilestep9

    sample_v2 Sample Programs

Note

Afterwards, open the project 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 Build> Build Solution.

    wincompilestep8

Run Sample Programs

After connecting to the computer, the depth camera will initiate system initialization. Once the power indicator light blinking at a frequency of 1Hz, you can get the depth maps by running the executable file lib/win/hostapp/x64/SimpleView_FetchFrame.exe in the development package in the Windows 10 X64 system:

  • For Windows10 X64 OS, run the executable file lib/win/hostapp/x64/SimpleView_FetchFrame.exe in the SDK package to obtain depth maps.

  • 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 maps.