From 8de01c90c2ae2db3a6b351228ad9c72eb42f5e02 Mon Sep 17 00:00:00 2001 From: lijun Date: Sat, 18 Jan 2025 19:41:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=88=86=E7=A6=BB=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E6=B5=81?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/tool.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/service/tool.go b/service/tool.go index 650af22..8da0661 100644 --- a/service/tool.go +++ b/service/tool.go @@ -182,6 +182,7 @@ func getVideoFrame(device proto.DeviceInfo) { lineType := 2 z := 0 var frame gocv.Mat + frame = gocv.NewMat() for { if device.LogFrame > 0 && z%device.LogFrame == 0 { log.Printf("设备:%d 当前帧: %d\n", device.ID, z) @@ -189,10 +190,6 @@ func getVideoFrame(device proto.DeviceInfo) { if device.NextStop { break } - if frame.Empty() { - frame = gocv.NewMat() - } - frame = gocv.NewMat() ok := webcam.Read(&frame) if !ok { log.Printf("设备:%v 错误: 无法从视频流中读取帧\n", device)