附录
智能相机配置文件
有参配置文件的内容、位置及文件名由客户自行定义配置,但格式及参数需按照以下要求:
- 配置文件为json格式。示例设置:/home/aidlux/camera_config.json
- 标注为必选参数或因为开关参数打开而成为必选参数,则必须配置。
- 相应参数的名字(大小写敏感)及类型必须符合下面表格要求。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| cameraId | string | 否 | 相机id。0:相机0主设备,1:相机1从设备,2:相机2从设备。不填时默认为相机0主设备。 |
| triggerWay | int | 是 | 触发方式。0:IO触发,1:软触发即连续触发。参数示例 "triggerWay": 0 |
| rimType | int | 否 | 边沿设置。0:上升沿,1:下降沿。(当为IO触发即"triggerWay": 0 时必须进行配置) |
| triggerDelay | int | 否 | 最小触发间隔(ms)。"triggerDelay": 0 时表示无延迟触发。 |
| debounce | int | 否 | 防抖间隔(ms),触发方式为IO触发时必填。参数示例 "debounce": 5 |
| inputChannel | int | 否 | IO输入类型。参数示例 "inputChannel": 1 |
| width | int | 是 | 图像的宽度设置。参数示例 "width": 1920 或者 "width": 3840 |
| height | int | 是 | 图像的高度设置。参数示例 "height" : 1080 或者 "height" : 2160 |
| fps | int | 相机的帧率(fps)。自动曝光关闭时必填。参数示例 "fps": 60 | |
| format | int | 是 | 相机编码目前仅支持35,后续再增加其他编码格式。参数示例 forrmat": 35 |
| exposureMeteringMode | int | 否 | 曝光测光模式,0表示关闭,1表示开启。参数示例 "exposureMeteringMode": 1 |
| autoExposure | bool | 是 | 自动曝光设置。true:开启曝光,false:关闭曝光。参数示例 "autoExposure": true |
| exposureCompensation | float | 否 | 曝光补偿设置,自动曝光开启时生效且必填 0:开启,1:关闭。参数示例 "exposureCompensation": 0 |
| exposureTime | long | 否 | 相机的曝光时长(us)。自动曝光关闭时必填。参数示例 "exposureTime": 20000000 |
| sensitivity | int | 否 | 相机的感光度(iso)。自动曝光关闭时必填。参数示例 "sensitivity": 500 |
| autoFocus | bool | 是 | 自动对焦,ture:开启自动对焦,false:关闭自动对焦。参数示例 "autoFocus": false |
| autoWhiteBalanceMode | int | 否 | 自动白平衡模式,自定义白平衡关闭时生效且必填,0:关闭白平衡模式,1:开启白平衡模式。参数示例 "autoWhiteBalanceMode": 1 |
| autoWhiteBalanceLock | bool | 否 | 自动白平衡当前是否锁定为最新计算值,自动白平衡时生效,true:开启锁定,false:关闭锁定。参数示例 "autoWhiteBalanceLock": false |
| customWhiteBalanceMode | int | 否 | 自定义白平衡模式,自定义白平衡开启时生效且必填,0:关闭,1:开启。参数示例 "customWhiteBalanceMode": 1 |
| colorCorrectionGains | array | 否 | 色彩矫正增益(4位float数组), RGB增益时生效且必填。参数示例 [1.0,1.0,1.0,1.0] |
| colorCorrectionTransform | array | 否 | 色彩矫正变换(18位int数组)。 参数示例 [1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1] |
| colorTemperature | int | 否 | 色温。参数示例 "colorTemperature": 5500 |
| contrast | int | 是 | 对比度。 取值范围(0 - 100) 参数示例 "contrast": 0 |
| sharpness | int | 是 | 锐度。 取值范围(0 - 100) 参数示例 "sharpness": 0 |
| saturation | int | 是 | 饱和度。 取值范围(0 - 100) 参数示例 "saturation": 0 |
有参配置文件参考内容:
json
{
"triggerWay" : 1,
"rimType" : 1,
"triggerDelay" : 0,
"width" : 1920,
"height" : 1080,
"fps": 30,
"format" : 35,
"autoExposure" : true,
"exposureCompensation" : 0,
"exposureTime" : 20000,
"sensitivity" : 500,
"autoFocus": true,
"customWhiteBalance": false,
"autoWhiteBalanceMode" : 1,
"autoWhiteBalanceLock" : false,
"customWhiteBalanceMode" : 1,
"colorCorrectionGains": [1.0,1.0,1.0,1.0],
"contrast" : 0,
"sharpness" : 0,
"saturation" : 0
}