C#

Description

The C# SDK uses three utility libraries to facilitate calls:

  1. RestSharp - Used to send HTTP requests

  2. Newtonsoft.Json - Used for parsing JSON strings

  3. SixLabors.ImageSharp - Used for storing image data

Interface Definition

Function Name Function Description Parameters and Return Values

public static string GetSDKVersion()

Get the SDK version number

Return Value: string type, SDK version number

public static string? GetHeader(string ip, string frameId, int timeout=2000)

Get camera photo information

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the camera

timeout: Timeout duration, default is 2000 ms

Return Value: string type, camera photo information including width and height

public static EpicEyeInfo? GetInfo(string ip, int timeout=2000)

Get camera information

Parameters:

ip: The IP address of the camera

timeout: Timeout duration, default is 2000 ms

Return Value: EpicEyeInfo type, detailed camera information

public static string? TriggerCapture(string? ip, bool withPointCloud = true, int timeout=2000)

Trigger a frame capture

Parameters:

ip: The IP address of the camera

withPointCloud: Whether to request point cloud data

timeout: Timeout duration, default is 2000 ms

Return Value: string type, returns frame ID for subsequent data retrieval

public static byte[]? GetPointCloud(string ip, string frameId, int timeout=15000)

Get point cloud data

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the data to be retrieved

timeout: Timeout duration, default is 15000 ms

Return Value: byte[] type, point cloud data

public static byte[]? GetDepth(string ip, string frameId, int timeout=15000)

Get depth map data

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the data to be retrieved

timeout: Timeout duration, default is 15000 ms

Return Value: byte[] type, depth map data

public static byte[]? GetImage(string ip, string frameId, int timeout=15000)

Get 2D image data

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the data to be retrieved

timeout: Timeout duration, default is 15000 ms

Return Value: byte[] type, image data

public static Hashtable? GetConfig(string ip, string frameId = "", int timeout=2000)

Get camera configuration parameters

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the data to be retrieved, empty string indicates getting the latest configuration

timeout: Timeout duration, default is 2000 ms

Return Value: Hashtable type, camera configuration data

public static bool SetConfig(string ip, Hashtable config, int timeout=2000)

Set camera configuration parameters

Parameters:

ip: The IP address of the camera

config: The camera configuration to be set

timeout: Timeout duration, default is 2000 ms

Return Value: bool type, indicates whether the configuration was set successfully

public static float[]? GetCameraMatrix(string ip, int timeout=2000)

Get the camera intrinsic matrix

Parameters:

ip: The IP address of the camera

timeout: Timeout duration, default is 2000 ms

Return Value: float[] type, 3x3 camera matrix

public static float[]? GetDistortion(string ip, int timeout=2000)

Get the camera distortion parameters

Parameters:

ip: The IP address of the camera

timeout: Timeout duration, default is 2000 ms

Return Value: float[] type, camera distortion parameters

public static (byte[]? imageBytes, byte[]? pointCloudBytes) GetPointCloudAndImageWithTimeStats(string ip, string frameId, ref double networkTransmitTimeMs, ref double networkSpeedMbps, int timeout = 15000)

Get point cloud and image data with transmission statistics

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the data to be retrieved

networkTransmitTimeMs: Network transmission time in milliseconds

networkSpeedMbps: Network speed in Mbps

timeout: Timeout duration, default is 15000 ms

Return Value: (byte[], byte[]) type, image data and point cloud data

public static byte[]? GetPointCloudInPly(string ip, string frameId, int timeout=15000)

Get point cloud data in PLY format

Parameters:

ip: The IP address of the camera

frameId: The frame ID of the data to be retrieved

timeout: Timeout duration, default is 15000 ms

Return Value: byte[] type, point cloud data in PLY format

public static List<EpicEyeInfo> SearchCamera()

Search for available cameras

Return Value: List<EpicEyeInfo> type, list of discovered cameras

Linux Execution

Refer to .NET and Ubuntu overview - .NET to configure the Dotnet environment on Linux. Navigate to the corresponding sample directory and run:

dotnet run

Windows Execution

  1. Refer to Install .NET on Windows - .NET to configure the Dotnet environment on Windows.

    Navigate to the corresponding sample directory via the command line and execute:

    dotnet run
  2. Alternatively, open the solution file (.sln) directly in Visual Studio and build the solution.

    csharp 1

    Select the corresponding project to execute

    csharp 2