SDK Application Reference

Sample Program Descriptions

The sample programs in sample_v2 introduce user-friendly camera control interfaces and offer an optional OpenCV dependency that users can choose to include if necessary.

Sample_v1

  • ListDevices: demonstrates how to list all the depth cameras that are connected to the host system.

  • DeviceStorage: demonstrates how to read from and write to the camera’s Custom Block Storage area (64KB) and the ISP Block Storage area (64KB).

  • DumpAllFeatures: demonstrates how to list the components and features supported by the depth camera, along with the read and write operations available for each feature.

  • ForceDeviceIP: demonstrates how to manually set the IP address for depth camera.

  • LoopDetect: demonstrates how to address data connection anomalies caused by unstable environmental factors.

  • NetStatistic: demonstrates how to calculate the packet loss rate of the network connection for the depth camera.

  • SimpleView_FetchFrame: demonstrates how to continuously capture and output image data when the depth camera is in continuous capture mode.

  • SimpleView_Callback: demonstrates how to capture image data in continuous capture mode and render it using OpenCV in a separate processing thread to prevent blocking.

  • SimpleView_FetchHisto: demonstrates how to retrieve the image brightness distribution histogram.

  • SimpleView_MultiDevice: demonstrates how to use multiple depth cameras to continuously capture and output image data.

  • SimpleView_Point3D: demonstrates how to acquire 3D point cloud data.

  • SimpleView_Registration: demonstrates how to obtain the intrinsic parameters, extrinsic parameters, depth map, and color image of the depth camera, and align the depth map with the color image.

  • SimpleView_TriggerDelay: demonstrates how to control the camera’s trigger delay.

  • SimpleView_TriggerMode0: demonstrates how to set the depth camera to trigger mode 0, allowing it to continuously capture and output images at the highest frame rate.

  • SimpleView_TriggerMode1: demonstrates how to set the depth camera to trigger mode 1, allowing it to acquire and output images upon receiving a trigger signal.

  • SimpleView_TriggerMode_M2S1: demonstrates how to set the master device (camera) to work in trigger mode 2, and multiple slave devices (cameras) to work in trigger mode 1, in order to achieve cascaded triggering among multiple depth cameras while capturing images simultaneously. Upon receiving a software trigger signal sent by the host computer, the master device outputs a trigger signal via the hardware TRIG_OUT interface, while simultaneously triggering itself to capture and output a depth map. After receiving the hardware trigger signal from the master device, the slave devices capture and output depth maps.

  • SimpleView_TriggerMode_M3S1: demonstrates how to set the master device (camera) to work in trigger mode 3, and multiple slave devices (cameras) to work in trigger mode 1, in order to achieve cascaded triggering of multiple depth cameras at the set frame rate while capturing images simultaneously. The master device outputs a trigger signal through the hardware TRIG_OUT interface at the set frame rate, while simultaneously triggering itself to capture and output a depth map. After receiving the hardware trigger signal from the master device, the slave devices capture and output depth maps.

  • SimpleView_SaveLoadConfig: demonstrates how to write a local JSON file into the camera’s Storage component and load the JSON file that has been written into the Storage component. Additionally, the program supports exporting the JSON file to the local system for checking and configuring parameters.

  • SimpleView_XYZ48: demonstrates how to parse and display depth maps in XYZ format.

  • SimpleView_Point3D_XYZ48: demonstrates how to acquire 3D point cloud data represented in xyz48 format.

  • SimpleView_OpenWithIP: demonstrates how to open the Network depth camera camera with the specified IP address.

  • SimpleView_StreamAsync: demonstrates how to con the camera to acquire streams and output image data asynchronously when the camera works in software trigger mode.

  • SimpleView_StreamAsync1: demonstrates how to con the camera to acquire streams and output image data asynchronously when the camera works in continuous capture mode.

  • SimpleView_PixelsRegistration: demonstrates how to display the position of the depth map center on the color image.

Sample_v2

  • ListDevices_v2: demonstrates how to list all depth cameras that are connected to the host computer.

  • DepthStream_v2: demonstrates how to acquire the depth map from the depth camera.

  • ExposureTimeSetting_v2: demonstrates how to set the exposure time of the camera’s color image.

  • ForceDeviceIP_v2: demonstrates how to forcibly set the IP address of the depth camera.

  • GetCalibData_v2: demonstrates how to get the raw calibration parameters of the depth camera.

  • TofDepthStream_v2: demonstrates how to perform distortion correction on a ToF depth map.

  • IREnhance_v2: performs image enhancement for the IR images of the ToF depth cameras.

  • NetStatistic_v2: demonstrates how to calculate the network packet loss rate of the depth camera.

  • OfflineReconnection_v2: demonstrates how to automatically reconnect the camera after a disconnection.

  • OpenWithInterface_v2: demonstrates how to access the camera through a specified network interface.

  • OpenWithIP_v2: demonstrates how to access the camera through a specified IP address.

  • PointCloud_v2: demonstrates how to acquire and save 3D point cloud data in PLY format.

  • Registration_v2: demonstrates how to register the depth and color images.

  • ResolutionSetting_v2: demonstrates how to set the image resolution through user interaction or by directly specifying the image mode.

  • SaveLoadConfig_v2: demonstrates how to save camera parameters to custom_block.bin (the camera’s internal memory) and export the camera parameters locally from it.

  • SoftTrigger_v2: demonstrates how to acquire and output images upon receiving a trigger signal.

  • StreamAsync_v2: demonstrates how to con the asynchronous output of image data streaming from the camera.

Application Example: Set Camera IP

This section introduces how to use the compiled ForceDeviceIP example to set the camera’s IP address and provides common examples of IP address configurations.

Note

Description of IP Address Types:

  • Temporary IP Address: A manually cond IP address temporarily assigned to the device.

  • Static IP Address: A manually cond IP address permanently assigned to the device.

  • Dynamic IP Address: An IP address automatically assigned by the DHCP (Dynamic Host Configuration Protocol) server in the network.

Commands

After executing the 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.

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

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

  • <MAC>: The camera MAC address. It can be obtained from the device label, with the format of xx:xx:xx:xx:xx:xx.

  • <newIP>: The IP address to be set.

  • <newNetmask>: The subnet mask corresponding to the IP address to be set.

  • <newGateway>: The default gateway corresponding to the IP address to be set.

Use Cases

Use Case 1

Set a static C-class IP address (192.168.5.12) for the Percipio network camera.

  1. Check the Current IP Address Configuration of the host computer.

    Press WIN+R, type cmd, then enter ipconfig and press Enter to view the network configuration.=

  2. Verify the computer’s IP address is within the target network segment.

    If the computer’s IP address (e.g., 192.168.6.xx) does not match the target network segment (e.g., 192.168.5.xx), you need to modify the computer’s IP address:

    1. Open Control Panel, then click “Network and Internet” > “Network and Sharing Center” > “Change adapter settings”.

    2. Right-click the “Ethernet” connection, and select “Properties” from the context menu.

    3. In the Ethernet Properties window, double-click “Internet Protocol Version 4 (TCP/IPv4)”. In the pop-up window, select “Use the following IP address” and con IP address, subnet mask and default gateway.

  1. Navigate to the SDK directory “lib\win\hostapp\x64” .Open Windows PowerShell in this directory and execute:

ForceDeviceIP.exe -static 06:29:39:05:DA:D1 192.168.5.12 255.255.255.0 192.168.5.1
  • 06:29:39:05:DA:D1 : camera MAC address.

  • 192.168.5.12 : newly set camera IP address.

  • 255.255.255.0 : the subnet mask corresponding to the newly set IP address.

  • 192.168.5.1 : the default gateway corresponding to the newly set IP address.

Use Case 2

Set a Dynamic IP Address for a Percipio Network Camera.

  1. Set host computer IP configuration to DHCP. For detailed configuration guide, refer to Con Host Computer Network (Windows Platform).

  2. Navigate to the SDK directory “lib\win\hostapp\x64” .Open Windows PowerShell in this directory and execute:

    ForceDeviceIP.exe -dynamic 06:29:39:05:DA:D1
    

    06:29:39:05:DA:D1 is the MAC address of the camera.