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 Camport4 SDK

  2. Install Dependencies

  3. Compile Sample Programs

  4. Run Sample Programs

Download Camport4 SDK

Choose any of the following methods to download Camport4 SDK :

  • Access https://github.com/percipioxyz/camport4.git using a browser and download the Camport4 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/camport4.git
    

The directory structure of Camport4 SDK is shown in the following figure:

Camport4 SDK Directory Structure

Camport4 SDK Directory Structure

Doc Directory

It stores the SDK API reference documentation. The documentation is 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 APIs.

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

  • TYVer.h: the header file for retrieving SDK version information.

  • TYParameter.h: the header file for the GenICam standard APIs.

  • TYDefs.h: the header file for Camport SDK data types.

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 subfolders including cloud_viewer, common, sample_v1, sample_v2 and sample_genicam_sfnc, where sample_v1, sample_v2 and sample_genicam_sfnc include sample programs provided for users to refer to when programming. For more details about the sample programs, please refer to Sample Program Descriptions.

Install Dependencies

Install CMake (V3.24.0)

  1. Download Windows installation package from CMake Official Website .

  2. Double click the downloaded .msi installer file and follow the wizard to complete the installation. Important: Select the option “Add CMake to PATH” during the installation process to configure system environment variables 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 Official 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. Specify the source code directory as sample and the output directory for compilation as “sample/build”.

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

    wincompilestep2
  5. In the OpenCV_DIR column, specify the path to “opencv/build”.

    wincompilestep3
  6. Select BUILD_SAMPLE_GENICAM_SFNC, BUILD_SAMPLE_V1 and BUILD_SAMPLE_V2.

    sdk4compilestep4
  7. Click on Generate.

    sdk4compilestep5
  8. Click on Open Project to open the project. In Visual Studio Tool Bar, change the solution configuration to “Release” mode.

    sdk4compilestep6-en

Note

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

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

    wincompilestep7-en

Run Sample Programs

After connecting to the computer, the depth camera will initiate system initialization. Once the camera STAT indicator light blinks 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/sample_trigger.exe in the SDK package, then select “Continuous” mode 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 sample_trigger.exe in the folder to capture the depth maps.