跳远
This commit is contained in:
parent
d5733d08f9
commit
2803691094
@ -66,15 +66,9 @@ namespace Views.JumpLong
|
||||
_humanGraphicsRenderer.DrawLabel = false;
|
||||
_objectDetector = ObjectDetectorFactory.CreateSportGoodsDetector();
|
||||
_detectQueue = new SportDetectionQueue();
|
||||
|
||||
_sport = SportBase.Create("standing-long-jump");
|
||||
_sport.OnTicked += this.OnSportTick;
|
||||
_detectQueue.Start();
|
||||
_measureApparatus = new ApparatusLongJumpDelineation();
|
||||
_measureApparatus.MeasureLength = 300;
|
||||
var _isCalibrated = this.ReactangleCalibrating(1920, 1080);
|
||||
_sport.MeasureApparatus = _measureApparatus;
|
||||
_detectQueue.Sport = _sport;
|
||||
|
||||
}
|
||||
|
||||
private async void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
@ -89,6 +83,14 @@ namespace Views.JumpLong
|
||||
_Points = db.JumpLongPoints.FirstOrDefault(x => x.Code == AppSettings.Code);
|
||||
|
||||
_mainWin.HumanFrameUpdated += OnFrameUpdated;
|
||||
_sport = SportBase.Create("standing-long-jump");
|
||||
_sport.OnTicked += this.OnSportTick;
|
||||
_sport.Start();
|
||||
// 开始跳远抽帧线程
|
||||
_mainWin.FacialRecognitionEvent += this.HumanPredicting;
|
||||
var _isCalibrated = this.ReactangleCalibrating(1920, 1080);
|
||||
_sport.MeasureApparatus = _measureApparatus;
|
||||
_detectQueue.Sport = _sport;
|
||||
}
|
||||
|
||||
|
||||
@ -106,8 +108,8 @@ namespace Views.JumpLong
|
||||
int leftWaving = DetectLeftHandRaise(humans);
|
||||
if (leftWaving == 5)
|
||||
{
|
||||
_mainWin.HumanFrameUpdated -= this.OnFrameUpdated;
|
||||
_mainWin.WebcamClient.StopExtract();
|
||||
//_mainWin.HumanFrameUpdated -= this.OnFrameUpdated;
|
||||
//_mainWin.WebcamClient.StopExtract();
|
||||
|
||||
// 举左手逻辑,例如结束动画或退出
|
||||
var newPage = new Home();
|
||||
@ -225,7 +227,6 @@ namespace Views.JumpLong
|
||||
var counts = _sport.GetFormatCounts();
|
||||
if (double.Parse(counts[..^1]) > 0 && _sportType == 1) //正向跳远时候&&处于测试阶段时候触发更新
|
||||
{
|
||||
|
||||
ImageBehavior.SetRepeatBehavior(centerImg4, new RepeatBehavior(2));
|
||||
ImageBehavior.SetRepeatBehavior(centerImg4, new RepeatBehavior(1));
|
||||
ImageBehavior.GetAnimationController(centerImg4).Play();
|
||||
@ -518,11 +519,6 @@ namespace Views.JumpLong
|
||||
centerImg4.Visibility = Visibility.Visible;
|
||||
//if (_sport?.IsCounting == true)
|
||||
//_mainWin.WebcamClient.OnExtractFrame += this.OnFrameExtracted;
|
||||
_sport.Start();
|
||||
_detectQueue.Start();
|
||||
|
||||
// 开始跳远抽帧线程
|
||||
_mainWin.FacialRecognitionEvent += this.HumanPredicting;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -108,6 +108,8 @@ namespace Wpf_AiSportsMicrospace.Views
|
||||
if (humans == null || humans.Count == 0)
|
||||
return;
|
||||
|
||||
FacialRecognitionEvent?.Invoke(frame);
|
||||
|
||||
// 触发全局事件
|
||||
this.Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user