From 1cbf9dcb1b6bb7a176f114fc133afabffcc15ae7 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Mon, 15 Sep 2025 13:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E9=87=8F=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Wpf_AiSportsMicrospace/MainWindow.xaml.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Wpf_AiSportsMicrospace/MainWindow.xaml.cs b/Wpf_AiSportsMicrospace/MainWindow.xaml.cs index 99c9775..81f60a8 100644 --- a/Wpf_AiSportsMicrospace/MainWindow.xaml.cs +++ b/Wpf_AiSportsMicrospace/MainWindow.xaml.cs @@ -50,7 +50,6 @@ public partial class MainWindow : Window _sports = SportBase.GetSports(); - _detectQueue = new SportDetectionQueue(); this.sportList.ItemsSource = _sports; this.sportList.SelectedIndex = 0; @@ -119,11 +118,20 @@ public partial class MainWindow : Window if (!Directory.Exists(tempPath)) Directory.CreateDirectory(tempPath); + + _sport.Reset(); + _sport.Start(); + _detectQueue.Start(); + var _webcamClient = WebcamClient.CreateRTSP(host, userName, password, port); //处理抽帧回调 _webcamClient.OnExtractFrame += this.OnFrameExtracted; _webcamClient.StartExtract();//开始抽帧 + + this.startOrStop.Content = "停止(&S)"; + this.sportCounts.Text = "0"; + this.sportTimes.Text = "00'00\""; } private async void OnFrameExtracted(VideoFrame frame) { @@ -137,7 +145,6 @@ public partial class MainWindow : Window var human = humanResult?.Humans?.FirstOrDefault(); _detectQueue.Enqueue(frame.Number, human, null); - //var count = _sport.GetFormatCounts(); } private void OnSportTick(int counts, int times) {