diff --git a/Wpf_AiSportsMicrospace/Common/SportOperate.cs b/Wpf_AiSportsMicrospace/Common/SportOperate.cs index 7fed95a..d955581 100644 --- a/Wpf_AiSportsMicrospace/Common/SportOperate.cs +++ b/Wpf_AiSportsMicrospace/Common/SportOperate.cs @@ -167,13 +167,14 @@ namespace Wpf_AiSportsMicrospace.Common if (wrist == null) return false; - if (shoulder != null && wrist.Y <= shoulder.Y + 40) - return true; + if (shoulder == null || elbow == null) + return false; - if (elbow != null && wrist.Y <= elbow.Y - 20) - return true; + bool wristAboveShoulder = wrist.Y <= shoulder.Y - 20; + bool wristAboveElbow = wrist.Y <= elbow.Y - 20; + bool closeToBody = Math.Abs(wrist.X - shoulder.X) <= 260; - return false; + return wristAboveShoulder && wristAboveElbow && closeToBody; } /// diff --git a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs index 2a864d9..c94f2fa 100644 --- a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs @@ -34,7 +34,7 @@ namespace Wpf_AiSportsMicrospace private WavingAction _lastGestureAction = WavingAction.None; private DateTime _lastMenuSlideTime = DateTime.MinValue; private bool _isNavigating; - private const int MenuSlideCooldownMs = 480; + private const int MenuSlideCooldownMs = 420; public Home() {