From 8acceae3cdf014a42d4aacc123560263880865b3 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期五, 15 十一月 2019 11:36:35 +0800
Subject: [PATCH] 给目标静止的第一帧画框给result
---
util/simpleCV.go | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/util/simpleCV.go b/util/simpleCV.go
index 27e8196..e88e0b8 100644
--- a/util/simpleCV.go
+++ b/util/simpleCV.go
@@ -155,8 +155,6 @@
}
}
}
-
-
func DrawPolygonOnImageForYolo(cameraId string, img protomsg.Image, results []structure.Result,url string) (maps map[string]interface{}, err0 error) {
rook, _ := gocv.NewMatFromBytes(int(img.Height), int(img.Width), gocv.MatTypeCV8UC3, img.Data)
@@ -170,6 +168,7 @@
// 鍒嗗壊鍖哄煙id闆嗗悎骞舵牴鎹甶d鏌ヨ鍖哄煙鐒跺悗鐢绘
for _,result := range results {
polygonIds := strings.Split(result.AlarmPolygon,",")
+ logger.Info("鍖哄煙ID锛�",result.AlarmPolygon,polygonIds)
for i := 0; i < len(polygonIds); i++ {
polygon := getPolygonById(polygonIds[i],cameraId)
if polygon.Polygon != "[]" && polygon.Polygon != ""{
@@ -179,8 +178,8 @@
}
// 鎶婄洰鏍囨鍑烘潵
for _,result := range results {
- for _,rect := range result.Location {
- gocv.Rectangle(&rook, image.Rect(int(rect.X), int(rect.Y), int(rect.X+rect.Width), int(rect.Y+rect.Height)), red, 1)
+ for _,rect := range result.AlarmObj {
+ gocv.Rectangle(&rook, image.Rect(int(rect.Location.X), int(rect.Location.Y), int(rect.Location.X+rect.Location.Width), int(rect.Location.Y+rect.Location.Height)), red, 1)
}
}
//return nil,nil
@@ -188,7 +187,7 @@
return
}
-func DrawPolygonOnImageForFace(cameraId string, img protomsg.Image, results []structure.FaceResult,url string) (maps map[string]interface{}, err0 error) {
+func DrawPolygonOnImageForFace(cameraId string, img protomsg.Image, results []structure.Result,url string) (maps map[string]interface{}, err0 error) {
rook, _ := gocv.NewMatFromBytes(int(img.Height), int(img.Width), gocv.MatTypeCV8UC3, img.Data)
//rook := gocv.IMRead("/home/user/workspace/ruleprocess/util/105.jpg",gocv.IMReadColor)
--
Gitblit v1.8.0