Sensor State#
这对于在采集图像时降低功耗、减少热量生成和减小延时非常有用。
该功能的使用#
为什么使用 Sensor State#
相机传感器具有以下电源状态:
- 在
- 待机
- 熄灭
相机启动或重置后的默认传感器状态为“待机模式”。配置某些参数时,传感器会自动切换至待机模式。开始图像采集时,传感器将再次打开,但有一定的延时。
Sensor State 功能使您可以手动设置传感器状态。这可以在采集图像时减少延时。
将传感器置于待机模式对于降低功耗和减少热量产生而言也非常有用。这进而会对图像质量产生积极的影响。
确定 Sensor State#
To determine the current sensor state, get the BslSensorState
parameter value.
设置 Sensor State#
要设置传感器状态,请执行以下命令之一:
BslSensorOn
: The sensor is switched on.BslSensorStandby
: The sensor is put in standby mode. Power consumption is reduced.BslSensorOff
: The sensor is switched off.
示例代码#
INodeMap& nodemap = camera.GetNodeMap();
// Get current sensor state
String_t e = CEnumParameter(nodemap, "BslSensorState").GetValue();
// Switch sensor power on
CCommandParameter(nodemap, "BslSensorOn").Execute();
// Put sensor in standby mode
CCommandParameter(nodemap, "BslSensorStandby").Execute();
// Switch sensor power off
CCommandParameter(nodemap, "BslSensorOff").Execute();
// Get current sensor state
string e = camera.Parameters[PLCamera.BslSensorState].GetValue();
// Switch sensor power on
camera.Parameters[PLCamera.BslSensorOn].Execute();
// Put sensor in standby mode
camera.Parameters[PLCamera.BslSensorStandby].Execute();
// Switch sensor power off
camera.Parameters[PLCamera.BslSensorOff].Execute();
size_t len = 0;
char e_str[64] = {0};
/* Get current sensor state */
len = sizeof(e_str);
errRes = PylonDeviceFeatureToString(hdev, "BslSensorState", e_str, &len);
CHECK(errRes);
/* Switch sensor power on */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslSensorOn");
CHECK(errRes);
/* Put sensor in standby mode */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslSensorStandby");
CHECK(errRes);
/* Switch sensor power off */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslSensorOff");
CHECK(errRes);
您也可以使用 pylon Viewer 轻松设置参数。