数量识别

This commit is contained in:
tanglong 2025-09-15 13:21:51 +08:00
parent 127052091e
commit 1cbf9dcb1b

View File

@ -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)
{