图漾相机——C#语言属性设置

发布于:2025-04-05 ⋅ 阅读:(17) ⋅ 点赞:(0)

文章目录

前言

请参考图漾官网的在线文档:
https://doc.percipio.xyz/cam/latest/getstarted/sdk-csharp-compile.html#windows-csharp-label
而如果不想配置环境,请参考预编译版本例子,下载地址:
https://doc.percipio.xyz/cam/latest/getstarted/compile.html

1.示例程序说明

示例程序存放在开发包根目录 csharp 文件夹内:
1.fetch_frame.cs:该示例在自由采集模式下采集深度图和彩色图。
2.fetch_IR.cs:该示例在自由采集模式下采集 IR 图。
3.fetch_isp.cs:该示例在软件层面对于彩色图像的 ISP 后处理,可将存在偏色的 RAW BAYER 图像处理成正常色彩空间的彩色图。
4.fetch_point3d.cs:该示例用于采集 3d 点云(未作显示),Log 信息显示点云个数和中心点云坐标(X,Y,Z)。
5.fetch_registration.cs:该示例用于采集 RGB-D 对齐图像。
6.fetch_trigger.cs:该示例用于设置相机工作在软触发模式下采集深度图。
7.offline_reconnection.cs :该例程⽤于处理因环境不稳定等因素造成的数据连接异常,并实现相机离线重连。
8.parameter_settings.cs:该例程⽤于设置不同数据类型的参数。例程中展⽰了如何关闭 RGB AEC(布尔型参数)、设置曝光时间(整型参数),以及设置图像分辨率和格式(枚举型参数)。

pcammls.dll :动态链接库。
pcammls.exp:中间⽂件。
pcammls.lib :依赖库。
pcammls_cs.dll :动态链接库。
注:前四个文件,均在编译后的camport _multi language/csharp_build_x64/Bin/Release 目录下。
tycam.dll:动态链接库。

如果不想编译,可下载预编译例程,链接如下:
https://gitee.com/percipioxyz/camport_multi_language_Release
在这里插入图片描述

2.SDK API功能介绍

本节主要介绍Csharp SDK中封装的一些接口。

2.1 ListDevice

该接口用于枚举与PC连接的所有相机。
示例如下

DeviceInfoVector dev_list= cl.ListDevice();

2.2 Open

该接口用于打开指定SN号的相机。
示例如下

System.IntPtr handle =cl.Open(207000145055);

2.3 OpenDeviceByIP

该接口用于打开指定p的相机。
示例如下:

System.IntPtr handle =cl.OpenDeviceByIP("192.168.6.85");

2.4 Close

该接口用于关闭相机
示例如下

cl.Close(handle);

2.5 DeviceStreamEnable

该接口用于使能数据流,如需使能Color和Depth数据流。
示例如下:

cl.DeviceStreamEnable(handle, PERCIPIO_STREAM_COLOR | PERCIPIO_STREAM_DEPTH);

2.6 DeviceStreamFormatDump

该接口用于列举数据流的分辨率格式。
示例如下

EnumEntryVector color_fmt_list = cl.DeviceStreamFormatDump(handle, PERCIPIO_STREAM_COLOR);
            if(color_fmt_list.Count() != 0) 
            { 
                Console.WriteLine(string.Format("color image format list:"));
                for (int i = 0; i < color_fmt_list.Count(); i++)
                {
                    TY_ENUM_ENTRY fmt = color_fmt_list[i];
                    Console.WriteLine(string.Format("\t{0} -size[{1}x{2}]\t-\t desc:{3}", i, cl.Width(fmt), cl.Height(fmt), fmt.getDesc()));
                }
            }

2.7 DeviceStreamFormatConfig

该接口用于配置数据流的分辨率,可与DeviceStreamFormatDump联合使用。
示例如下

cl.DeviceStreamFormatConfig(handle, PERCIPIO_STREAM_COLOR, color_fmt_list[0]);

表示配置列表中的第一个分辨率。

2.8 DeviceReadCurrentEnumData

该接口用于读取当前数据流所用的分辨率
示例如下

TY_ENUM_ENTRY color_enum_desc = new TY_ENUM_ENTRY();
cl.DeviceReadCurrentEnumData(handle, PERCIPIO_STREAM_COLOR, color_enum_desc);
Console.WriteLine($"current color image mode   {color_enum_desc.getDesc()}");  

2.9 DeviceReadCalibData

该接口用于读取数据流的标定参数。
示例如下:

PercipioCalibData color_calib_data   = cl.DeviceReadCalibData(handle, PERCIPIO_STREAM_COLOR);
int color_calib_width  = color_calib_data.Width();
int color_calib_height = color_calib_data.Height();
CalibDataVector color_calib_intr   = color_calib_data.Intrinsic();
CalibDataVector color_calib_extr   = color_calib_data.Extrinsic();
CalibDataVector color_calib_dis    = color_calib_data.Distortion();

2.10 DeviceStreamOn

开启数据流,类似于C++中TYStartCapture接口。
示例如下:

cl.DeviceStreamOn(handle);

2.11 DeviceStreamOff

关闭数据流,类似于C++中TYStopCapture接口。
示例如下:

cl.DeviceStreamOff(handle) ;

2.12 DeviceStreamRead

读取相机的传送的数据,类似于C++中TYFetchFrame接口。
示例如下:

FrameVector frames = cl.DeviceStreamRead(handle, 5000); 

2.13 DeviceStreamDepthRender

该接口用于解析和渲染深度图像。
示例如下:

image_data depth = new image_data();
cl.DeviceStreamDepthRender(frames[i], depth);
IntPtr pt = depth.buffer.getCPtr();
Bitmap bmp_depth = new Bitmap(depth.width, depth.height, depth.width * 3, PixelFormat.Format24bppRgb, pt);
pictureBox1.Image = (Image)(new Bitmap(bmp_depth, new Size(640, 480))).Clone();

2.14 DeviceStreamImageDecode

该接口用于解析RGB图像。
示例如下:

image_data bgr = new image_data();
cl.DeviceStreamImageDecode(frames[i], bgr);
IntPtr pt = bgr.buffer.getCPtr();
Bitmap bmp_color = new Bitmap(bgr.width, bgr.height, bgr.width * 3, PixelFormat.Format24bppRgb, pt);
pictureBox2.Image = (Image)(new Bitmap(bmp_color, new Size(640, 480))).Clone();

2.15 DeviceStreamIRRender

该接口用于解析ir图像。
示例如下:

image_data rightIR = new image_data();
cl.DeviceStreamIRRender(frames[i], rightIR);
IntPtr pt = rightIR.buffer.getCPtr();
Bitmap rightIR_BMP = new Bitmap(rightIR.width, rightIR.height, 3*rightIR.width, PixelFormat.Format24bppRgb, pt);
pictureBox2.Image = (Image)(new Bitmap(rightIR_BMP, new Size(640, 480))).Clone();

2.16 DeviceControlLaserPowerAutoControlEnable

该接口用于使能/失能 **TY_BOOL_LASER_AUTO_CTRL**属性,用于需要分析ir散斑图时,点亮激光器。
示例如下:

cl.DeviceControlLaserPowerAutoControlEnable(handle, false);

2.17 DeviceControlLaserPowerConfig

该接口用于调整激光器亮度。
示例如下:

cl.DeviceControlLaserPowerConfig(handle, 80);

2.18 DeviceColorStreamIspEnable

该接口用于打开/关闭软件isp。
示例如下:

cl.DeviceColorStreamIspEnable(handle, true);

2.19 DeviceStreamMapDepthImageToColorCoordinate

该接口用于将深度图坐标映射到彩色图,可参考fetch_registration_cs*。
示例如下:
SDK3.6.51此接口有变化,若SDK版本低于3.6.51,以下代码不可用。

cl.DeviceStreamMapDepthImageToColorCoordinate(depth_calib,depth,scale_unit,color_calib,undsitortion_color.width,undsitortion_color.height,registration_depth);

2.20 DeviceStreamMapRGBImageToDepthCoordinate

该接口用于将彩色图坐标映射到深度图。
示例如下:

cl.DeviceStreamMapRGBImageToDepthCoordinate(depth_calib,depth,scale_unit,color_calib, undsitortion_color, registration_color);

SDK3.6.66新增接口。

2.21 DeviceStreamDoUndistortion

该接口用于对图像做畸变校正,可参考fetch_registration_cs。
示例如下:

cl.DeviceStreamDoUndistortion(color_calib, color, undsitortion_color);

2.22 DeviceControlTriggerModeEnable

`该接口用于设置相机的工作模式。·
示例如下:

cl.DeviceControlTriggerModeEnable(handle, 1);

0代表 TY_TRIGGER_MODE_OFF,
1代表 TY_TRIGGER_MODE_SLAVE。

2.23 DeviceControlTriggerModeSendTriggerSignal

该接口用于给相机发送软触发命令,类似于C++中TYSendSoftTrigger。
示例如下:

cl.DeviceControlTriggerModeSendTriggerSignal(handle);

2.24DeviceStreamMapDepthImageToPoint3D

该接口用于将深度图转换成点云数据,可参fetch_point3d_cs。
示例如下:

cl.DeviceStreamMapDepthImageToPoint3D(image, depth_calib_data, f_depth_scale, p3d_list);

2.25 IPv4StringToInt

该接口可以将字符串转换成整型,应用于相机的ip设置。

但是因为没有TYForceDeviceIP接口,所以只把参数写入了相机,不会立刻更新,需要重启相机才可以生效。

示例如下:

int ip = cl.IPv4StringToInt("0.0.0.0");
DevParam param = cl.DevParamFromInt(ip);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_IP, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_IP);
int read_param_m = read_param.toInt();
Console.WriteLine($"{read_param_m}");

int netmask = cl.IPv4StringToInt("0.0.0.0");
DevParam param1 = cl.DevParamFromInt(netmask);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_SUBMASK, param1);
DevParam read_param1 = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_SUBMASK);
int read_param_m1 = read_param1.toInt();
Console.WriteLine($"{read_param_m1}");

int gateway = cl.IPv4StringToInt("0.0.0.0");
DevParam param2 = cl.DevParamFromInt(gateway);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_GATEWAY, param2);
DevParam read_param2 = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_GATEWAY);
int read_param_m2 = read_param2.toInt();
Console.WriteLine($"{read_param_m2}");

2.26 DevParamFromInt

该接口用于定义Int类型的变量,变量数据类型:int。
示例如下:

DevParam param =  cl.DevParamFromInt(4096);

2.27 DevParamFromEnum

该接口用于定义Enum类型的变量,变量数据类型:uint。
示例如下:

DevParam param =  cl.DevParamFromEnum(TY_DEPTH_QUALITY_BASIC);

2.28 DevParamFromBool

该接口用于定义Bool型变量,用于设置Bool类型的feature。
示例如下:

DevParam param =  cl.DevParamFromBool(true);

2.29 DevParamFromFloat

该接口用于定义Float型变量,用于设置Float类型的feature。
示例如下:

DevParam param = cl.DevParamFromFloat(2.2f);

2.30 DeviceSetParameter

该接口用于设置相机参数,可以设置Int、Enum、Bool、Float、Array型参数。

2.31 DeviceGetParameter

该接口用于读取相机参数,可以读取Int、Enum、Bool、Float、Array型参数。
DeviceSetParameterDeviceGetParameter的示例代码如下:

2.31.1 Int型

DevParam param = cl.DevParamFromInt(1088);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_EXPOSURE_TIME, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_EXPOSURE_TIME);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

2.31.2 Enum型

DevParam param = cl.DevParamFromEnum(TY_TIME_SYNC_TYPE_HOST);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_TIME_SYNC_TYPE, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_TIME_SYNC_TYPE);
uint m_read_param = read_param.toEnum();
Console.WriteLine($"current value {m_read_param}");
EnumEntryVector m_read_param2 = read_param.eList();
for (int i = 0; i < m_read_param2.Count(); i++){
         Console.WriteLine($"{ m_read_param2[i].value}");
}

2.31.3 Bool型

DevParam param = cl.DevParamFromBool(false);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_EXPOSURE, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_EXPOSURE);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

2.31.4 Float型

DevParam param = cl.DevParamFromFloat(0.0125f);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_FLOAT_SCALE_UNIT, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_FLOAT_SCALE_UNIT);
float m_read_param = read_param.toFloat();
Console.WriteLine($"current value {m_read_param}");
float min = read_param.fMin();
float max = read_param.fMax();
float inc = read_param.fInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

2.31.5 Array型

ByteArrayVector array = new ByteArrayVector { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 14, 0, 0, 0 };
 DevParam arr = cl.DevParamFromByteArray(array);
 cl.DeviceSetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_BYTEARRAY_HDR_PARAMETER,arr);
  DevParam hdr_arry = cl.DeviceGetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_BYTEARRAY_HDR_PARAMETER);
   ByteArrayVector hdr_arry_1 = hdr_arry.toByteArray();
    for (int i = 0; i < hdr_arry_1.Count(); i++)
     {
      Console.Write($",{hdr_arry_1[i]}");
       }

2.31.6 Struct(roi)型

PercipioAecROI roi = new PercipioAecROI(0, 0, 640, 480);
DevParam param = cl.DevParamFromPercipioAecROI(roi);
 cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_STRUCT_AEC_ROI, param);
 DevParam readParam = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_STRUCT_AEC_ROI);
ArrayVector mReadParam = readParam.toArray();
Console.WriteLine("aec roi: " + string.Join(",", mReadParam));

2.32 获取网络相机信息接口get_netinfo

该接口可用于获取打开的网络相机的设备信息,如ip、mac、netmask、gateway。
ip的获取示例如下:

handle = cl.Open(dev_list[select].id);
Console.WriteLine("ip {0}", dev_list[select].get_netinfo().ip());

2.33 DeviceLoadDefaultParameters

该接口用于加载相机的配置文件(custom_block.bin文件中保存的相机参数json文件)。

int err = cl.DeviceLoadDefaultParameters(handle);
            if (err != TY_STATUS_OK)
                Console.WriteLine(string.Format("Load default parameters fail: {0}!", err));
            else
                Console.WriteLine(string.Format("Load default parameters successful!"));

支持加载的参数类型有Int、Float、Enum、Bool、和BYTEARRAY。

2.34 DeviceWriteDefaultParametersFromJSFile

该接口用于将本地json文件中保存的参数内容写入相机custom_block.bin文件。

string filePath = @"C:\Users\G\Desktop\1.json";
cl.DeviceWriteDefaultParametersFromJSFile(handle, filePath);

2.35 DeviceClearDefaultParameters

用于清除相机内存中的内容。

cl.DeviceClearDefaultParameters(handle);

2.36 DeviceHasStream

该接口用于判断相机是否具有特定的数据流,返回值为bool型。
示例:判断相机是否具有color数据流。

bool has_stream = false;
has_stream = cl.DeviceHasStream(handle, PERCIPIO_STREAM_IR_RIGHT);
Console.WriteLine($"has right ir  {has_stream}");

2.37 DeviceReadRectifiedRotationData

该接口用于读取V相机的IR rotation。
示例:读取IR rotation数据

PercipioRectifyRotaData LEFTIR_rot_data = cl.DeviceReadRectifiedRotationData(handle, PERCIPIO_STREAM_IR_LEFT);
CalibDataVector LEFTIR_r_data = LEFTIR_rot_data.Data();
Console.WriteLine(string.Format(":IR_rot_data"));
dump_calib_data(LEFTIR_r_data, 3, 3);

2.38 DeviceReadRectifiedIntrData

该接口用于读取V相机的IR rectified intrinsic。

PercipioRectifyIntrData LEFTIR_int_data = cl.DeviceReadRectifiedIntrData(handle, PERCIPIO_STREAM_IR_LEFT);
CalibDataVector LEFTIR_i_data = LEFTIR_int_data.Data();
Console.WriteLine(string.Format(":IR_ntrinsic _data"));
dump_calib_data(LEFTIR_i_data, 3, 3);

3.组件属性设置

3.1 Device组件

3.1.1 TY_INT_PERSISTENT_IP 静态 IP 地址

int ip = cl.IPv4StringToInt("0.0.0.0");
DevParam param = cl.DevParamFromInt(ip);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_IP, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_IP);
int read_param_m = read_param.toInt();
Console.WriteLine($"{read_param_m}");

3.1.2 TY_INT_PERSISTENT_SUBMASK 静态 IP 子网掩码

int netmask = cl.IPv4StringToInt("0.0.0.0");
DevParam param1 = cl.DevParamFromInt(netmask);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_SUBMASK, param1);
DevParam read_param1 = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_SUBMASK);
int read_param_m1 = read_param1.toInt();
Console.WriteLine($"{read_param_m1}");

3.1.3 TY_INT_PERSISTENT_GATEWAY 静态 IP 网关

int gateway = cl.IPv4StringToInt("0.0.0.0");
DevParam param2 = cl.DevParamFromInt(gateway);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_GATEWAY, param2);
DevParam read_param2 = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PERSISTENT_GATEWAY);
int read_param_m2 = read_param2.toInt();
Console.WriteLine($"{read_param_m2}");

3.1.4 TY_INT_PACKET_DELAY 数据传输延迟时间

原理说明:Packet_Delay包延迟时间,是增加一张图像帧头和帧尾之间,Block id与Block id之间的时间间隔,通过增加Block id时间间隔,适当牺牲帧率,来降低对实时带宽的要求,保证相机在网络较差的环境也能取到图。
在这里插入图片描述

DevParam param = cl.DevParamFromInt(0);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PACKET_DELAY, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PACKET_DELAY);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.1.5 TY_INT_PACKET_SIZE 数据传输包大小

DevParam param = cl.DevParamFromInt(1500);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PACKET_SIZE, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_PACKET_SIZE);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.1.6 TY_BOOL_GVSP_RESEND 网络重传

设置相机网络重传指令,网络较差时防止丢包。

DevParam param = cl.DevParamFromBool(false);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_GVSP_RESEND, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_GVSP_RESEND);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.1.7 TY_INT_ACCEPTABLE_PERCENT 接收包比例

通过设置接收包比例,正常情况下,相机输出的行数在帧超时时间内达到设置的图像高度(Height参数),输出一帧图像。

若相机输出的行数在帧超时时间内未达到设置的图像高度(Height参数),则SDK按照实际高度输出该图像(设定的出图比例)。

DevParam param = cl.DevParamFromInt(90);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_ACCEPTABLE_PERCENT, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_ACCEPTABLE_PERCENT);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.1.8 TY_BOOL_KEEP_ALIVE_ONOFF 状态保持开关

DevParam param = cl.DevParamFromBool(false);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_KEEP_ALIVE_ONOFF, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_KEEP_ALIVE_ONOFF);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.1.9 TY_INT_KEEP_ALIVE_TIME 状态保持时间

DevParam param = cl.DevParamFromInt(3000);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_KEEP_ALIVE_TIMEOUT, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_KEEP_ALIVE_TIMEOUT);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.1.10 TY_ENUM_TRIGGER_POL

 DevParam param = cl.DevParamFromEnum(TY_TRIGGER_POL_FALLINGEDGE);
        cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_TRIGGER_POL, param);
        DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_TRIGGER_POL);
        uint m_read_param = read_param.toEnum();
        Console.WriteLine($"current value {m_read_param}");
        EnumEntryVector m_read_param2 = read_param.eList();
        for (int i = 0; i < m_read_param2.Count(); i++)
        {
            Console.WriteLine($"{ m_read_param2[i].value}");
        }

3.1.11 TY_INT_FRAME_PER_TRIGGER

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_FRAME_PER_TRIGGER, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_FRAME_PER_TRIGGER);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
EnumEntryVector m_read_param2 = read_param.eList();
for (int i = 0; i < m_read_param2.Count(); i++)
{
Console.WriteLine($"{ m_read_param2[i].value}");
}

3.1.12 TY_INT_CAPTURE_TIME_US 采集时间

DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_CAPTURE_TIME_US);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");

3.1.13 TY_INT_NTP_SERVER_IP ntp服务器ip

ntp服务器ip

int ip = cl.IPv4StringToInt("0.0.0.0");
DevParam param = cl.DevParamFromInt(ip);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_NTP_SERVER_IP, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_INT_NTP_SERVER_IP);
int read_param_m = read_param.toInt();
Console.WriteLine($"{read_param_m}");

3.1.14 TY_BOOL_CMOS_SYNC 图像同步

DevParam param = cl.DevParamFromBool(false);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_CMOS_SYNC, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_CMOS_SYNC);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.1.15 TY_ENUM_STREAM_ASYNC 数据流同步

DevParam param = cl.DevParamFromEnumt(TY_STREAM_ASYNC_ALL);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_STREAM_ASYNC, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_STREAM_ASYNC);
uint m_read_param = read_param.toEnum();
Console.WriteLine($"current value {m_read_param}");
EnumEntryVector m_read_param2 = read_param.eList();
for (int i = 0; i < m_read_param2.Count(); i++)
{
Console.WriteLine($"{ m_read_param2[i].value}");
}

3.1.16 TY_ENUM_TIME_SYNC_TYPE

DevParam param = cl.DevParamFromEnum(TY_TIME_SYNC_TYPE_HOST);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_TIME_SYNC_TYPE, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_TIME_SYNC_TYPE);
uint m_read_param = read_param.toEnum();
Console.WriteLine($"current value {m_read_param}");
EnumEntryVector m_read_param2 = read_param.eList();
for (int i = 0; i < m_read_param2.Count(); i++){
Console.WriteLine($"{ m_read_param2[i].value}");
}

3.1.17 TY_BOOL_TIME_SYNC_READY

DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_BOOL_TIME_SYNC_READY);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.1.18 TY_ENUM_CONFIG_MODE

DevParam param = cl.DevParamFromEnum(TY_CONFIG_MODE_PRESET0);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_CONFIG_MODE, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEVICE, TY_ENUM_CONFIG_MODE);
uint m_read_param = read_param.toEnum();
Console.WriteLine($"current value {m_read_param}");
EnumEntryVector m_read_param2 = read_param.eList();
for (int i = 0; i < m_read_param2.Count(); i++)
{
Console.WriteLine($"{ m_read_param2[i].value}");
}

3.2 Depth 组件

3.2.1 TY_ENUM_IMAGE_MODE 深度图图像格式

DevParam param = cl.DevParamFromEnum(TY_PIXEL_FORMAT_DEPTH16 | TY_RESOLUTION_MODE_1280x960);
        cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_ENUM_IMAGE_MODE, param);
        DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_ENUM_IMAGE_MODE);
        uint m_read_param = read_param.toEnum();
        Console.WriteLine($"current value {m_read_param}");
        EnumEntryVector m_read_param2 = read_param.eList();
        for (int i = 0; i < m_read_param2.Count(); i++)
        {
            Console.WriteLine($"description {m_read_param2[i].description}, value { m_read_param2[i].value} ");
        }

3.2.2 TY_FLOAT_SCALE_UNIT

DevParam param = cl.DevParamFromFloat(0.0125f);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_FLOAT_SCALE_UNIT, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_FLOAT_SCALE_UNIT);
float m_read_param = read_param.toFloat();
Console.WriteLine($"current value {m_read_param}");
float min = read_param.fMin();
float max = read_param.fMax();
float inc = read_param.fInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.3 Color组件

3.3.1 TY_INT_EXPOSURE_TIME

设置RGB相机的曝光时间

DevParam param = cl.DevParamFromInt(500);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_EXPOSURE_TIME, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_EXPOSURE_TIME);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.3.2 TY_INT_ANALOG_GAIN

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_ANALOG_GAIN, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_ANALOG_GAIN);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.3.3 TY_INT_R_GAIN

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_R_GAIN, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_R_GAIN);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.3.4 TY_INT_G_GAIN

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_G_GAIN, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_G_GAIN);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.3.5 TY_INT_B_GAIN

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_B_GAIN, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_B_GAIN);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.3.6 TY_BOOL_AUTO_GAIN

设置RGB相机的自动增益

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_GAIN, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_GAIN);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.3.7 TY_BOOL_AUTO_AWB 白平衡

设置RGB相机的自动白平衡

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_AWB, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_AWB);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.3.8 TY_STRUCT_AEC_ROI

PercipioAecROI roi = new PercipioAecROI(0, 0, 640, 480);
DevParam param1 = cl.DevParamFromPercipioAecROI(roi);
 cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_STRUCT_AEC_ROI, param1);
 DevParam readParam = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_STRUCT_AEC_ROI);
ArrayVector mReadParam = readParam.toArray();
Console.WriteLine("aec roi: " + string.Join(",", mReadParam));

3.3.9 TY_BOOL_AUTO_EXPOSURE

设置RGB相机的自动曝光属性

DevParam param = cl.DevParamFromBool(false);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_EXPOSURE, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_BOOL_AUTO_EXPOSURE);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.3.10 TY_INT_AE_TARGET_Y

DevParam param = cl.DevParamFromInt(200);
cl.DeviceSetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_AE_TARGET_Y, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_RGB_CAM, TY_INT_AE_TARGET_Y);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.4 IR和光源组件

3.4.1 TY_INT_GAIN

DevParam param = cl.DevParamFromInt(500);
cl.DeviceSetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_INT_GAIN, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_INT_GAIN);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.4.2 TY_FLOAT_EXPOSURE_TIME_US

DevParam param2 = cl.DevParamFromFloat(1088);
int error2 = cl.DeviceSetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_FLOAT_EXPOSURE_TIME_US, param2);
DevParam read_param2 = cl.DeviceGetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_FLOAT_EXPOSURE_TIME_US);
float m_read_param2 = read_param2.toFloat();
Console.WriteLine($"current value {m_read_param2}");
float min2 = read_param2.fMin();
float max2 = read_param2.fMax();
float inc2 = read_param2.fInc();
Console.WriteLine($"min :{min2},max:{max2},inc:{inc2}");

3.4.3 TY_BOOL_LASER_AUTO_CTRL

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_LASER, TY_BOOL_LASER_AUTO_CTRL, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_LASER, TY_BOOL_LASER_AUTO_CTRL);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.4.4 TY_INT_LASER_POWER

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_LASER, TY_INT_LASER_POWER, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_LASER, TY_INT_LASER_POWER);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.4.5 TY_BOOL_HDR

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_IR_CAM_LEFT,TY_BOOL_HDR, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_BOOL_HDR);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.4.6 TY_BYTEARRAY_HDR_PARAMETER

ByteArrayVector array = new ByteArrayVector { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 14, 0, 0, 0 };
DevParam arr = cl.DevParamFromByteArray(array);
cl.DeviceSetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_BYTEARRAY_HDR_PARAMETER,arr);
DevParam hdr_arry = cl.DeviceGetParameter(handle, TY_COMPONENT_IR_CAM_LEFT, TY_BYTEARRAY_HDR_PARAMETER);
ByteArrayVector hdr_arry_1 = hdr_arry.toByteArray();
for (int i = 0; i < hdr_arry_1.Count(); i++){
    Console.Write($",{hdr_arry_1[i]}");
  }

3.4.7 TY_BOOL_IR_FLASHLIGHT

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_LASER, TY_BOOL_IR_FLASHLIGHT, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_LASER, TY_BOOL_IR_FLASHLIGHT);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.4.8 TY_INT_IR_FLASHLIGHT_INTENSITY

DevParam param = cl.DevParamFromInt(0);
cl.DeviceSetParameter(handle, TY_COMPONENT_LASER, TY_INT_IR_FLASHLIGHT_INTENSITY, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_LASER, TY_INT_IR_FLASHLIGHT_INTENSITY);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5 TOF相机Depth组件

3.5.1 TY_ENUM_DEPTH_QUALITY

3.5.2 TY_INT_TOF_CHANNEL

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_CHANNEL, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_CHANNEL);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5.3 TY_INT_TOF_MODULATION_THRESHOLD

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_MODULATION_THRESHOLD, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_MODULATION_THRESHOLD);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5.4 TY_INT_TOF_ANTI_SUNLIGHT_INDEX

DevParam param = cl.DevParamFromInt(2);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_ANTI_SUNLIGHT_INDEX, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_ANTI_SUNLIGHT_INDEX);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5.5 TY_INT_TOF_JITTER_THRESHOLD

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_JITTER_THRESHOLD, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_JITTER_THRESHOLD);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5.6 TY_INT_TOF_HDR_RATIO

DevParam param = cl.DevParamFromInt(1);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_HDR_RATIO, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_TOF_HDR_RATIO);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
nt min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5.7 TY_BOOL_TOF_ANTI_INTERFERENCE

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_TOF_ANTI_INTERFERENCE, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_TOF_ANTI_INTERFERENCE);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.5.8 TY_INT_MAX_SPECKLE_SIZE

DevParam param = cl.DevParamFromInt(200);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_MAX_SPECKLE_SIZE, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_MAX_SPECKLE_SIZE);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.5.9 TY_INT_MAX_SPECKLE_DIFF

DevParam param = cl.DevParamFromInt(200);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_MAX_SPECKLE_DIFF, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_MAX_SPECKLE_DIFF);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6 PS/FM855等相机SGBM特性

3.6.1 TY_INT_SGBM_DISPARITY_NUM

DevParam param = cl.DevParamFromInt(3);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_DISPARITY_NUM, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_DISPARITY_NUM);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.2 TY_INT_SGBM_DISPARITY_OFFSET

DevParam param = cl.DevParamFromInt(3);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_DISPARITY_OFFSET, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_DISPARITY_OFFSET);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.3 TY_INT_SGBM_MATCH_WIN_HEIGHT

DevParam param = cl.DevParamFromInt(3);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_MATCH_WIN_HEIGHT, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_MATCH_WIN_HEIGHT);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.4 TY_INT_SGBM_MATCH_WIN_WIDTH

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_MATCH_WIN_WIDTH, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_MATCH_WIN_WIDTH);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.5 TY_INT_SGBM_IMAGE_NUM

DevParam param = cl.DevParamFromInt(3);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_IMAGE_NUM, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_IMAGE_NUM);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.6 TY_INT_SGBM_SEMI_PARAM_P1

DevParam param = cl.DevParamFromInt(10000);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_SEMI_PARAM_P1, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_SEMI_PARAM_P1);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.7 TY_INT_SGBM_SEMI_PARAM_P1_SCALE

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_SEMI_PARAM_P1_SCALE, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_SEMI_PARAM_P1_SCALE);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.8 TY_INT_SGBM_SEMI_PARAM_P2

DevParam param = cl.DevParamFromInt(0);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_SEMI_PARAM_P2, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_SEMI_PARAM_P2);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.9 TY_INT_SGBM_UNIQUE_FACTOR

DevParam param = cl.DevParamFromInt(511);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_UNIQUE_FACTOR, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_UNIQUE_FACTOR);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.10 TY_INT_SGBM_UNIQUE_ABSDIFF

DevParam param = cl.DevParamFromInt(10000);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_UNIQUE_ABSDIFF, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_UNIQUE_ABSDIFF);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.11 TY_BOOL_SGBM_HFILTER_HALF_WIN

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_SGBM_HFILTER_HALF_WIN, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_SGBM_HFILTER_HALF_WIN);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.6.12 TY_BOOL_SGBM_LRC

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_SGBM_LRC, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_SGBM_LRC);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.6.13 TY_INT_SGBM_LRC_DIFF

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_LRC_DIFF, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_LRC_DIFF);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.6.14 TY_BOOL_SGBM_MEDFILTER

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_SGBM_MEDFILTER, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_BOOL_SGBM_MEDFILTER);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.6.15 TY_INT_SGBM_MEDFILTER_THRESH

DevParam param = cl.DevParamFromInt(5);
cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_MEDFILTER_THRESH, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_MEDFILTER_THRESH);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.7 带泛光相机RGB属性

3.7.1 TY_BOOL_RGB_FLASHLIGHT

DevParam param = cl.DevParamFromBool(true);
cl.DeviceSetParameter(handle, TY_COMPONENT_LASER, TY_BOOL_RGB_FLASHLIGHT, param);
DevParam status = cl.DeviceGetParameter(handle, TY_COMPONENT_LASER, TY_BOOL_RGB_FLASHLIGHT);
bool m_status = status.toBool();
Console.WriteLine($"current value {m_status}");

3.7.2 TY_INT_RGB_FLASHLIGHT_INTENSITY

DevParam param = cl.DevParamFromInt(0);
cl.DeviceSetParameter(handle, TY_COMPONENT_LASER, TY_INT_RGB_FLASHLIGHT_INTENSITY, param);
DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_LASER, TY_INT_RGB_FLASHLIGHT_INTENSITY);
int m_read_param = read_param.toInt();
Console.WriteLine($"current value {m_read_param}");
int min = read_param.mMin();
int max = read_param.mMax();
int inc = read_param.mInc();
Console.WriteLine($"min :{min},max:{max},inc:{inc}");

3.7.3 TY_INT_SGBM_TEXTURE_THRESH

  DevParam param = cl.DevParamFromInt(1088);
    int error = cl.DeviceSetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_TEXTURE_THRESH, param);
    DevParam read_param = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_TEXTURE_THRESH);
    int m_read_param = read_param.toInt();
    int min = read_param.mMin();
    int max = read_param.mMax();
    int inc = read_param.mInc();
    Console.WriteLine($"min :{min},max:{max},inc:{inc}+++++{m_read_param}");

3.7.4 TY_INT_SGBM_TEXTURE_OFFSET

DevParam read_param1 = cl.DeviceGetParameter(handle, TY_COMPONENT_DEPTH_CAM, TY_INT_SGBM_TEXTURE_OFFSET);
int m_read_param1 = read_param1.toInt();
int min1 = read_param1.mMin();
int max1 = read_param1.mMax();
int inc1 = read_param1.mInc();
Console.WriteLine($"min :{min1},max:{max1},inc:{inc1}++++++++++{m_read_param1}");

运行上报[error] The feature is not writable. 改属性仅可读。

4.常见问题FAQ