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