From d1fcaa07e439cb521b100ed28fa39077593837cc Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期二, 24 九月 2019 16:49:55 +0800 Subject: [PATCH] --- --- util/simpleCV.go | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/util/simpleCV.go b/util/simpleCV.go index 44f6500..7dabefc 100644 --- a/util/simpleCV.go +++ b/util/simpleCV.go @@ -170,7 +170,8 @@ logger.Info("-----------------------鐪嬬湅鎶ヨ鍖哄煙id锛�",polygonIds) for i := 0; i < len(polygonIds)-1; i++ { polygon := getPolygonById(polygonIds[i],cameraId) - if polygon.Polygon != "[]" { + if polygon.Polygon != "[]" && polygon.Polygon != ""{ + logger.Debug("鎵�鐢诲尯鍩燂細",polygon.Polygon) DrawAPolygon(&rook,polygon.Polygon,yellow) } } @@ -225,9 +226,9 @@ points := ruleserver.Json2points(polygonString) for index := 0; index < len(points); index++ { if index == len(points)-1 { // 闂悎鍥惧舰 - gocv.Line(rook, image.Pt(int(points[index].X), int(points[index].Y)), image.Pt(int(points[0].X), int(points[0].Y)), color, 2) + gocv.Line(rook, image.Pt(int(points[index].X*1.33), int(points[index].Y*1.33)), image.Pt(int(points[0].X*1.33), int(points[0].Y*1.33)), color, 2) } else { - gocv.Line(rook, image.Pt(int(points[index].X), int(points[index].Y)), image.Pt(int(points[index+1].X), int(points[index+1].Y)), color, 2) + gocv.Line(rook, image.Pt(int(points[index].X*1.33), int(points[index].Y*1.33)), image.Pt(int(points[index+1].X*1.33), int(points[index+1].Y*1.33)), color, 2) } } } -- Gitblit v1.8.0