| | |
| | | //区域视频在线率的内部类 |
| | | private static class AreaStats { |
| | | int totalSites = 0; |
| | | int osdAccuracySites = 0; |
| | | int timeAccuracySites = 0; |
| | | |
| | | int importantTotalSites = 0; |
| | | int importantOsdAccuracySites = 0; |
| | |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | //校验osd |
| | | if (checkOsd(result)) { |
| | | stats.osdAccuracySites++; |
| | | } |
| | | //校验时间偏差 |
| | | if (checkTime(result)) { |
| | | stats.timeAccuracySites++; |
| | | } |
| | | |
| | | //重点点位 |
| | | if (important.contains(result.getDeviceNo())) { |
| | | stats.importantTotalSites++; |
| | |
| | | if (checkIndexVideo == null) { |
| | | return null; |
| | | } |
| | | //调用osd标注计算方法 |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("totalSites", stats.totalSites); |
| | | param.put("osdAccuracySites", stats.osdAccuracySites); |
| | | BigDecimal osdAccuracy = osdAccuracy(param); |
| | | checkIndexVideo.setAnnotationAccuracy(osdAccuracy); |
| | | |
| | | //调用osd标注计算方法 计算重点osd标注 |
| | | Map<String, Object> importantParam = new HashMap<>(); |
| | | importantParam.put("totalSites", stats.importantTotalSites); |
| | |
| | | BigDecimal imOsdAccuracy = osdAccuracy(importantParam); |
| | | checkIndexVideo.setKeyAnnotationAccuracy(imOsdAccuracy); |
| | | |
| | | //调用osd时间准确率 |
| | | Map<String, Object> timeParam = new HashMap<>(); |
| | | timeParam.put("totalSites", stats.totalSites); |
| | | timeParam.put("timeAccuracySites", stats.timeAccuracySites); |
| | | BigDecimal osdTimeAccuracy = osdTimeAccuracy(timeParam); |
| | | checkIndexVideo.setTimingAccuracy(osdTimeAccuracy); |
| | | //调用osd时间准确率,计算重点 |
| | | Map<String, Object> importantTimeParam = new HashMap<>(); |
| | | importantTimeParam.put("totalSites", stats.importantTotalSites); |