SDK application reference

By running the executable file in the SDK development package lib/win/hostapp/x64 , or running the executable file in the sample/build/bin/Release directory, the camera can be easily used.

In addition, Percipio provides Percipio Viewer, an image viewing software developed based on the SDK, which supports users to quickly view depth images, color images, infrared images, and point clouds. It also allows real-time adjustment of camera exposure parameters, laser brightness, etc. Download link for Percipio Viewer installation package: https://www.percipio.xyz/downloadcenter/. Please refer to Percipio Viewer user guide for instructions on how to use it.

Sample program instructions

ListDevices

This sample program is used to enumerate all depth cameras connected to the host computer.

DumpAllFeatures

This sample program is used to enumerate the various components and features supported by the depth camera, as well as detailed information of each feature.

ForceDeviceIP

This sample program is used to set the IP address of the network depth camera.

LoopDetect

This sample program is used to handle data communication exceptions caused by environmental instabilities and other factors.

SimpleView_FetchFrame

This sample program is used to continuously capture images and output image data when the depth camera is working in free acquisition mode.

SimpleView_Callback

This sample program is used to continuously capture images when the depth camera is working in free acquisition mode and performs OpenCV rendering and outputs image data in a separate data processing thread to prevent blocking of image data acquisition.

SimpleView_FetchHisto

This sample program is used to obtain the histogram of image brightness data.

SimpleView_MultiDevice

This sample program is used to simultaneously capture images from multiple depth cameras and output image data.

SimpleView_Point3D

This sample program is used to acquire 3D point cloud data.

SimpleView_Registration

This sample program is used to obtain the intrinsic and extrinsic parameters, depth image and color image of a depth camera, and align the depth image and color image.

SimpleView_TriggerDelay

This sample program is used to set the hardware trigger delay time. The depth camera captures images after receiving a hardware trigger signal and waiting for a specific delay.

SimpleView_TriggerMode0

This sample program is used to set the depth camera to work in mode 0, where the camera continuously captures images and outputs image data at the highest frame rate.

SimpleView_TriggerMode1

This sample program is used to set the depth camera to work in mode 1, where the camera captures images and outputs image data after receiving a software trigger command or a hardware trigger signal.

SimpleView_TriggerMode_M2S1

This sample program is used to set the master device (camera) to work in mode 2, and multiple slave devices (cameras) to work in mode 1, in order to achieve cascaded trigger of multiple depth cameras and capture images simultaneously.

After receiving the software trigger signal sent by the host computer, the master device captures and outputs depth images, and at the same time outputs the trigger signal through the TRIG_OUT hardware interface. After receiving the hardware trigger signal from the master device, the slave device captures and outputs depth images.

SimpleView_TriggerMode_M3S1

This sample program is used to set the master device (camera) to work in mode 3, and multiple slave devices (cameras) to work in mode 1, in order to achieve cascaded trigger of multiple depth cameras according to the set frame rate, and capture images simultaneously.

After receiving the software trigger signal sent by the host computer at the set frame rate, the master device captures and outputs depth images, and at the same time outputs the trigger signal through the TRIG_OUT hardware interface. After receiving the hardware trigger signal from the master device, the slave device captures and outputs depth images.

SimpleView_TriggerMode18

This sample program is used to set the depth camera to work in mode 18. After receiving a software trigger command or a hardware trigger signal, the camera will capture one round of images and output image data in a 1+duty manner according to the set frame rate (1: emit one time of floodlight; duty: emit duty times of laser).

SimpleView_TriggerMode19

This sample program is used to set the depth camera to work in mode 19. After receiving a software trigger command or a hardware trigger signal, the camera will continuously capture images and outputs image data in a 1+duty manner according to the set frame rate (1: emit one time of floodlight; duty: emit duty times of laser).

SimpleView_TriggerMode20

This sample program is used to set the depth camera to work in mode 20. Based on the set trigger start time (start_time_us), the time interval array between every two frames (offset_us_list[]) and the number of triggers (offset_us_count), the camera captures (1 + offset_us_count) frames of images and outputs the image data. This work mode requires the camera to start PTP synchronization first, and offset_us_count ≤ 50.

SimpleView_TriggerMode21

This sample program is used to set the depth camera to work in mode 21. Based on the set trigger start time (start_time_us), the number of triggers (trigger_count) and trigger time interval (period_us), the camera captures one frame of image every period_us, accumulating a total of trigger_count frames, and outputs the image data. This work mode requires the camera to start PTP synchronization first.

Application example: Setting the IP address of the network depth camera

The sample program for setting the IP address of the network depth camera: ForceDeviceIP

Instructions

  • Set as temporary IP address

    Command: ForceDeviceIP.exe -force <MAC> <newIP> <newNetmask> <newGateway>

    Where,

    • <MAC> can be obtained from the device label, the format is xx:xx:xx:xx:xx:xx;

    • <newIP> is the specified IP address;

    • <newNetmask> and <newGateway> are set according to newIP.

    Sample code: ForceDeviceIP.exe -force 68:f7:56:36:90:a3 192.168.1.160 255.255.255.0 192.168.1.1

    After executing this command, the IP address of the network depth camera will be modified to the IP address specified by the command, and it will take effect immediately; after the camera is powered off and rebooted, the original configuration will be restored.

  • Set as static IP address

    Command: ForceDeviceIP.exe -static <MAC> <newIP> <newNetmask> <newGateway>

    Where,

    • <MAC> can be obtained from the device label, the format is xx:xx:xx:xx:xx:xx;

    • <newIP> is the specified IP address;

    • <newNetmask> and <newGateway> are set according to newIP.

    Sample code: ForceDeviceIP.exe -static 68:f7:56:36:90:a3 192.168.1.160 255.255.255.0 192.168.1.1

    After executing this command, the IP address of the network depth camera will be modified to the IP address specified by the command, and it will take effect immediately; after the camera is powered off and rebooted, the IP address will remain unchanged as configured by the command.

  • Set as dynamic IP address (supported by new version of cameras)

    Command: ForceDeviceIP.exe -dynamic <MAC>

    Where, <MAC> can be obtained from the device label, the format is xx:xx:xx:xx:xx:xx.

    Sample code: ForceDeviceIP.exe -dynamic 68:f7:56:36:90:a3

    After executing this command, the IP configuration of the network depth camera will be cleared and restored to DHCP dynamic acquisition mode, and the camera immediately request an IP address from DHCP; After the camera is powered off and rebooted, it will actively request an IP address from DHCP. Some older models of cameras do not support this command.

  • Set as dynamic IP address (supported by old/new version of cameras)

    Command: ForceDeviceIP.exe -dynamic <MAC> <newIP> <newNetmask> <newGateway>

    Where, - <MAC> can be obtained from the device label, the format is xx:xx:xx:xx:xx:xx; - <newIP> <newNetmask> <newGateway> are temporary IP address and subnet mask.

    Sample code: ForceDeviceIP.exe -dynamic 68:f7:56:36:90:a3 192.168.1.160 255.255.255.0 192.168.1.1

    After executing this command, the camera will temporarily use the newIP configuration, then clear the camera’s IP configuration and restore it to DHCP dynamic acquisition mode and immediately request an IP address from DHCP. After the camera is powered off and rebooted, the camera will continue to request an IP address from DHCP.

Application Scenario 1

The network camera can be found through the SDK sample program ListDevices, but cannot be open through the SDK sample program SimpleView_FetchFrame.

In such cases, you can configure the camera’s IP address to be on the same network segment as the computer’s IP address.

Taking the Windows operating system as an example, do the following:

  1. Enter the SDK sample/build/bin/Release directory and execute the command: ForceDeviceIP.exe -force <MAC> <newIP> <Netmask> <Gateway>, where newIP should be in the same network segment as the computer’s IP address, with the same subnet mask and gateway as the computer.

  2. Execute the following commands as needed to set the IP address of the camera:

    • Dynamic IP address: ForceDeviceIP.exe -dynamic <MAC> or ForceDeviceIP.exe -dynamic <MAC> <newIP> <newNetmask> <newGateway>

    • Static IP address: ForceDeviceIP.exe -static <MAC> <newIP> <newNetmask> <newGateway>

Application Scenario 2

Change the dynamic IP address of the network camera to a static IP address.

Taking the Windows operating system as an example, do the following:

  1. If the new static IP address is not in the same network segment as the computer’s IP address, first modify the IP address of the computer.

    For example, if the new static IP address is 192.168.5.XX, open the Control Panel on your computer, navigate to “Network and Internet” > “Network and Sharing Center” > “Change adapter settings” > “Ethernet” > “Internet Protocol Version 4 (TCP/IPv4)”. In the popped-up Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, select “Use the following IP address” and set the IP address, subnet mask, and gateway:

    修改计算机 IP 地址

    Configure the IP address of the computer

  2. Enter the SDK sample/build/bin/Release directory and execute the command: ForceDeviceIP.exe -static <MAC> <newIP> <Netmask> <Gateway>, where newIP is the static IP address to be changed to.