适配设备
人脸识别终端TPS980P,
测温机器人K27
接口调用说明
安装TemperatureService.apk ,集成telpo_temperature.jar,主要接口如下:
1.初始化
public static ThermalImageUtil thermalImageUtil;
@Override
public void onCreate() {
super.onCreate();
initLicense(this);
thermalImageUtil = new ThermalImageUtil(this, new ThermalImageUtil.ThermalImageListener() {
@Override
public void onThermalImageInitSuccess() {
Log.i("xuxl", "ThermalImageUtil 创建成功");
//只有收到创建成功,才能调用测温接口
}
@Override
public void onThermalDeath() {
Log.i("xuxl", "测温服务异常死亡");
}
});
}
2.调用测温接口
Rect faceRect = new Rect(rectleft, recttop, rectright, rectbottom);
getDataAndBitmap(faceRect, 50, 1,hotImageCallback)
使用该测温sdk注意事项
需要确保设备有测温模块,并确认设备是否已安装TemperatureService.apk,
同时要保证设备已开机热机,并且使用环境不能正对空调、窗户等光线和热源的地方,会导致测温不准确,
调用测温时,建议根据人脸算法识别到的人脸坐标,传入rect参数保证测温模块能够正确取到额头问题,
测温模块的成像像素为32*32,纵向为x轴,横向是y轴,与人脸坐标的横为x,纵为y的不同,
即对应关系,
测温的坐标--------人脸的坐标
faceRect.top-----rectF.left
faceRect.left-----rectF.top
faceRect.bottom-----rectF.right
faceRect.right-----rectF.left
其中人脸坐标,主要取到大致范围即可,
你可以参考以下坐标计算方式
recttop = (int) rectF.right * 32 / 600;
rectleft = (int) rectF.top * 32 / 800;
if (recttop < 12) {
recttop = recttop + 6;
}
if (recttop > 12) {
recttop = recttop - 6;
}
if (rectleft > 10) {
rectleft = rectleft / 2;
}
rectbottom = recttop + 8;
rectright = rectleft + 8;
Rect faceRect = new Rect(rectleft, recttop, rectright, rectbottom);
getDataAndBitmap(faceRect, 50, 1,hotImageCallback)