大疆社区
标题:
御2行业双光测温问题 Android
[打印本页]
作者:
lkandroid
时间:
2020-5-27
标题:
御2行业双光测温问题 Android
本帖最后由 lkandroid 于 2020-5-28 13:18 编辑
我在使用御2行业版双光进行区域测温,给我反馈出来的温度,上限,下线以及平均都是一个值这是为啥?thermalAreaTemperatureAggregations.getMaxAreaTemperature()+
" Mode:0 "
+thermalAreaTemperatureAggregations.getMinAreaTemperature()+
" Mode:0 "
+thermalAreaTemperatureAggregations.getAverageAreaTemperature()
作者:
Spacemarine
时间:
2020-5-27
你是不是区域定义得太小啊?只测出了一个温度。
作者:
lkandroid
时间:
2020-5-28
自己填坑:
1.首先设定为红外模式:
Camera camera= ((Aircraft) FPVDemoApplication.getProductInstance()).getCameras().get(1);
if(camera!=null){
camera.setDisplayMode(THERMAL_ONLY, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
setResultToToast("Mode: " + (djiError == null ? "Successfully" : djiError.getDescription()));
if (djiError == null)
runOnUiThread(new Runnable() {
@Override
public void run() {
camera_status.setText("模式:热成像");
}
});
}
});
}else
setResultToToast("Mode:NotSupport " );
2.设定为区域测温模式:
Camera camera1= ((Aircraft) FPVDemoApplication.getProductInstance()).getCameras().get(1);
if(camera1!=null) {
camera1.setThermalMeasurementMode(ThermalMeasurementMode.AREA_METERING, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if (djiError == null) {
showToast("success!! 11");
} else {
showToast("filar!! " + djiError.getDescription());
}
}
});
}
}
3.设定测温区域,获得数据反馈:
Camera camera1= ((Aircraft) FPVDemoApplication.getProductInstance()).getCameras().get(1);
if(camera1!=null) {
camera1.setThermalMeteringArea(new RectF(0, 0, 0.8f, 0.8f), new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if (djiError == null) {
showToast("success22");
camera1.setThermalAreaTemperatureAggregationsCallback(new ThermalAreaTemperatureAggregations.Callback() {
@Override
public void onUpdate(ThermalAreaTemperatureAggregations thermalAreaTemperatureAggregations) {
if (thermalAreaTemperatureAggregations.getMaxAreaTemperature() > 10)
showToast("Mode:0 " + thermalAreaTemperatureAggregations.getMaxAreaTemperature() + " Mode:0 " + thermalAreaTemperatureAggregations.getMinAreaTemperature() + " Mode:0 " + thermalAreaTemperatureAggregations.getAverageAreaTemperature());
}
});
} else showToast("failer22 " + djiError.getDescription());
}
});
}
填坑完毕!
欢迎光临 大疆社区 (https://bbs.dji.com/)
Powered by Discuz! X3.2