数量识别
This commit is contained in:
parent
127052091e
commit
1cbf9dcb1b
@ -50,7 +50,6 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
_sports = SportBase.GetSports();
|
_sports = SportBase.GetSports();
|
||||||
|
|
||||||
|
|
||||||
_detectQueue = new SportDetectionQueue();
|
_detectQueue = new SportDetectionQueue();
|
||||||
this.sportList.ItemsSource = _sports;
|
this.sportList.ItemsSource = _sports;
|
||||||
this.sportList.SelectedIndex = 0;
|
this.sportList.SelectedIndex = 0;
|
||||||
@ -119,11 +118,20 @@ public partial class MainWindow : Window
|
|||||||
if (!Directory.Exists(tempPath))
|
if (!Directory.Exists(tempPath))
|
||||||
Directory.CreateDirectory(tempPath);
|
Directory.CreateDirectory(tempPath);
|
||||||
|
|
||||||
|
|
||||||
|
_sport.Reset();
|
||||||
|
_sport.Start();
|
||||||
|
_detectQueue.Start();
|
||||||
|
|
||||||
var _webcamClient = WebcamClient.CreateRTSP(host, userName, password, port);
|
var _webcamClient = WebcamClient.CreateRTSP(host, userName, password, port);
|
||||||
|
|
||||||
//处理抽帧回调
|
//处理抽帧回调
|
||||||
_webcamClient.OnExtractFrame += this.OnFrameExtracted;
|
_webcamClient.OnExtractFrame += this.OnFrameExtracted;
|
||||||
_webcamClient.StartExtract();//开始抽帧
|
_webcamClient.StartExtract();//开始抽帧
|
||||||
|
|
||||||
|
this.startOrStop.Content = "停止(&S)";
|
||||||
|
this.sportCounts.Text = "0";
|
||||||
|
this.sportTimes.Text = "00'00\"";
|
||||||
}
|
}
|
||||||
private async void OnFrameExtracted(VideoFrame frame)
|
private async void OnFrameExtracted(VideoFrame frame)
|
||||||
{
|
{
|
||||||
@ -137,7 +145,6 @@ public partial class MainWindow : Window
|
|||||||
var human = humanResult?.Humans?.FirstOrDefault();
|
var human = humanResult?.Humans?.FirstOrDefault();
|
||||||
_detectQueue.Enqueue(frame.Number, human, null);
|
_detectQueue.Enqueue(frame.Number, human, null);
|
||||||
|
|
||||||
//var count = _sport.GetFormatCounts();
|
|
||||||
}
|
}
|
||||||
private void OnSportTick(int counts, int times)
|
private void OnSportTick(int counts, int times)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user