C#

설명

C# SDK에서는 호출을 편리하게 하기 위해 세 가지 유틸리티 라이브러리를 사용합니다.

  1. RestSharp - HTTP 요청을 전송하기 위해 사용

  2. Newtonsoft.Json - JSON 문자열을 파싱하기 위해 사용

  3. SixLabors.ImageSharp - 이미지 데이터를 저장하기 위해 사용

인터페이스 정의

함수명 기능 설명 매개변수와 반환값

public static string GetSDKVersion()

SDK 버전 번호 가져오기

반환값: string 타입, SDK 버전 번호

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

카메라 사진 정보 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 카메라의 프레임 ID

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: string 타입, 카메라 사진 정보(너비와 높이 포함)

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

카메라 정보 가져오기

매개변수:

ip: 카메라의 IP 주소

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: EpicEyeInfo 타입, 카메라의 상세 정보

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

프레임 촬영 트리거

매개변수:

ip: 카메라의 IP 주소

withPointCloud: 포인트 클라우드 데이터 요청 여부

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: string 타입, 이후 데이터 가져오기에 사용되는 frameId 반환

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

포인트 클라우드 데이터 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 데이터를 가져올 프레임 ID

timeout: 타임아웃 시간, 기본값 15000 ms

반환값: byte[] 타입, 포인트 클라우드 데이터

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

깊이 맵 데이터 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 데이터를 가져올 프레임 ID

timeout: 타임아웃 시간, 기본값 15000 ms

반환값: byte[] 타입, 깊이 맵 데이터

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

2D 이미지 데이터 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 데이터를 가져올 프레임 ID

timeout: 타임아웃 시간, 기본값 15000 ms

반환값: byte[] 타입, 이미지 데이터

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

카메라 설정 파라미터 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 데이터를 가져올 프레임 ID, 빈 문자열은 최신 설정을 가져옴

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: Hashtable 타입, 카메라 설정 데이터

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

카메라 설정 파라미터 설정하기

매개변수:

ip: 카메라의 IP 주소

config: 설정할 카메라 파라미터

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: bool 타입, 설정 성공 여부

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

카메라 내부 행렬 가져오기

매개변수:

ip: 카메라의 IP 주소

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: float[] 타입, 3x3 카메라 행렬

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

카메라 왜곡 파라미터 가져오기

매개변수:

ip: 카메라의 IP 주소

timeout: 타임아웃 시간, 기본값 2000 ms

반환값: float[] 타입, 카메라 왜곡 파라미터

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

전송 통계와 함께 포인트 클라우드와 이미지 데이터 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 데이터를 가져올 프레임 ID

networkTransmitTimeMs: 네트워크 전송 시간(ms)

networkSpeedMbps: 네트워크 속도(Mbps)

timeout: 타임아웃 시간, 기본값 15000 ms

반환값: (byte[], byte[]) 타입, 이미지 데이터와 포인트 클라우드 데이터

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

PLY 형식의 포인트 클라우드 데이터 가져오기

매개변수:

ip: 카메라의 IP 주소

frameId: 데이터를 가져올 프레임 ID

timeout: 타임아웃 시간, 기본값 15000 ms

반환값: byte[] 타입, PLY 형식의 포인트 클라우드 데이터

public static List<EpicEyeInfo> SearchCamera()

카메라 검색

반환값: List<EpicEyeInfo> 타입, 검색된 카메라 목록

Linux에서 실행

Linux 환경에서 Dotnet을 설정하려면 .NET and Ubuntu overview - .NET를 참조하십시오. 샘플 디렉토리로 이동하여 다음 명령을 실행합니다.

dotnet run

Windows에서 실행

  1. Windows 환경에서 Dotnet을 설정하려면 Install .NET on Windows - .NET를 참조하십시오.

    명령 프롬프트에서 샘플 디렉토리로 이동하여 다음 명령을 실행합니다.

    dotnet run
  2. Visual Studio를 사용하는 경우, 관련 솔루션 파일(.sln)을 직접 열고 솔루션을 빌드합니다.

    csharp 1

    관련 프로젝트를 선택하여 실행

    csharp 2