diff --git a/Wpf_AiSportsMicrospace/Common/SportOperate.cs b/Wpf_AiSportsMicrospace/Common/SportOperate.cs
index 7148e16..5be2d76 100644
--- a/Wpf_AiSportsMicrospace/Common/SportOperate.cs
+++ b/Wpf_AiSportsMicrospace/Common/SportOperate.cs
@@ -56,7 +56,7 @@ namespace Wpf_AiSportsMicrospace.Common
{
try
{
- _webcamClient = WebcamClient.CreateRTSP("172.17.30.64", "admin", "yd708090", 554u);
+ _webcamClient = WebcamClient.CreateRTSP("172.17.30.65", "admin", "yd708090", 554u);
}
catch (Exception)
{
diff --git a/Wpf_AiSportsMicrospace/MainWindow.xaml b/Wpf_AiSportsMicrospace/MainWindow.xaml
index 30dd2fe..1e0865f 100644
--- a/Wpf_AiSportsMicrospace/MainWindow.xaml
+++ b/Wpf_AiSportsMicrospace/MainWindow.xaml
@@ -19,7 +19,7 @@
DisplayMemberPath="Name"
SelectedValuePath="Key"
SelectionChanged="sportList_SelectionChanged" d:IsHidden="True"/>
-
+
diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml
index 8ce338a..05cabf9 100644
--- a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml
+++ b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml
@@ -19,11 +19,11 @@
/>
-
+
-
+
= 3)
+ int leftWaving = DetectLeftHandRaise(humans);
+ if (leftWaving == 5)
{
- switch (rightWaving)
+ _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
+ _mainWin.WebcamClient.StopExtract();
+
+ // 举左手逻辑,例如结束动画或退出
+ var newPage = new Home();
+ _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
+ }
+ else {
+ int rightWaving = DetectRightHandRaise(humans);
+ if (rightWaving >= 3)
{
- case (int)WavingAction.FirstHand:
- StartCountdown(3);
- break;
- case (int)WavingAction.Raising:
- UpdateCountdown();
- break;
- case (int)WavingAction.RaiseHand:
- FinishCountdown();
- _currentGameState = GameState.Running; // 倒计时完成 → 游戏开始
- break;
+ switch (rightWaving)
+ {
+ case (int)WavingAction.FirstHand:
+ StartCountdown(3);
+ break;
+ case (int)WavingAction.Raising:
+ UpdateCountdown();
+ break;
+ case (int)WavingAction.RaiseHand:
+ FinishCountdown();
+ _currentGameState = GameState.Running; // 倒计时完成 → 游戏开始
+ break;
+ }
}
}
break;
@@ -196,18 +208,18 @@ namespace Wpf_AiSportsMicrospace.Views
// if (CheckGameFinished()) _currentGameState = GameState.Finished;
break;
- case GameState.Finished: // 游戏完成
- int leftWaving = DetectLeftHandRaise(humans);
- if (leftWaving == 5)
- {
- _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
- _mainWin.WebcamClient.StopExtract();
+ //case GameState.Finished: // 游戏完成
+ // int leftWaving = DetectLeftHandRaise(humans);
+ // if (leftWaving == 5)
+ // {
+ // _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
+ // _mainWin.WebcamClient.StopExtract();
- // 举左手逻辑,例如结束动画或退出
- var newPage = new Home();
- _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
- }
- break;
+ // // 举左手逻辑,例如结束动画或退出
+ // var newPage = new Home();
+ // _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
+ // }
+ // break;
}
}
catch (Exception ex)
@@ -283,7 +295,7 @@ namespace Wpf_AiSportsMicrospace.Views
ShowRankingBoard(RankingItemList);
Utils.StopBackgroundMusic();
- _currentGameState = GameState.Finished;
+ _currentGameState = GameState.NotStarted;
_mainWin.HumanFrameUpdated += OnHumanFrameUpdated;
_mainWin.WebcamClient.StartExtract();
}
diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs
index a0db29a..dc098fe 100644
--- a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs
+++ b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs
@@ -43,7 +43,7 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
// 容忍时间(节拍误差)
- public double _beatTolerance = 0.15; // ±150ms
+ public double _beatTolerance = 0.2; // ±150ms
private int _totalDots = 0;
// 滚动显示的节拍点集合
public ObservableCollection BeatDisplayLeft { get; set; } = new();
@@ -171,21 +171,34 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
switch (_currentGameState)
{
case GameState.NotStarted: // 未开始
- int rightWaving = DetectRightHandRaise(humans);
- if (rightWaving >= 3)
+ int leftWaving = DetectLeftHandRaise(humans);
+ if (leftWaving == 5)
{
- switch (rightWaving)
+ _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
+ _mainWin.WebcamClient.StopExtract();
+
+ // 举左手逻辑,例如结束动画或退出
+ var newPage = new Home();
+ _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
+ }
+ else
+ {
+ int rightWaving = DetectRightHandRaise(humans);
+ if (rightWaving >= 3)
{
- case (int)WavingAction.FirstHand:
- StartCountdown(3);
- break;
- case (int)WavingAction.Raising:
- UpdateCountdown();
- break;
- case (int)WavingAction.RaiseHand:
- FinishCountdown();
- _currentGameState = GameState.Running; // 倒计时完成 → 游戏开始
- break;
+ switch (rightWaving)
+ {
+ case (int)WavingAction.FirstHand:
+ StartCountdown(3);
+ break;
+ case (int)WavingAction.Raising:
+ UpdateCountdown();
+ break;
+ case (int)WavingAction.RaiseHand:
+ FinishCountdown();
+ _currentGameState = GameState.Running; // 倒计时完成 → 游戏开始
+ break;
+ }
}
}
break;
@@ -197,18 +210,18 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
// if (CheckGameFinished()) _currentGameState = GameState.Finished;
break;
- case GameState.Finished: // 游戏完成
- int leftWaving = DetectLeftHandRaise(humans);
- if (leftWaving == 5)
- {
- _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
- _mainWin.WebcamClient.StopExtract();
+ //case GameState.Finished: // 游戏完成
+ // int leftWaving = DetectLeftHandRaise(humans);
+ // if (leftWaving == 5)
+ // {
+ // _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
+ // _mainWin.WebcamClient.StopExtract();
- // 举左手逻辑,例如结束动画或退出
- var newPage = new Home();
- _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
- }
- break;
+ // // 举左手逻辑,例如结束动画或退出
+ // var newPage = new Home();
+ // _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
+ // }
+ // break;
}
}
catch (Exception ex)
@@ -288,7 +301,7 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
// 更新游戏状态
- _currentGameState = GameState.Finished;
+ _currentGameState = GameState.NotStarted;
// 恢复视频流
Application.Current.Dispatcher.Invoke(() =>
@@ -306,9 +319,9 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
{
double left = _musicJumpRopeContext.UserBeatSyncList[0];
double right = _musicJumpRopeContext.UserBeatSyncList[1];
- score3.Text = (left * 10).ToString();
- score4.Text = (right * 10).ToString();
- if (left < right)
+ score4.Text = (left * 10).ToString();
+ score3.Text = (right * 10).ToString();
+ if (left > right)
{
lose1.Margin = new Thickness(60, 0, 0, 0);
lose2.Margin = new Thickness(60, 0, 0, 0);
diff --git a/Wpf_AiSportsMicrospace/Views/Main.xaml b/Wpf_AiSportsMicrospace/Views/Main.xaml
index 43d4407..b80a7a1 100644
--- a/Wpf_AiSportsMicrospace/Views/Main.xaml
+++ b/Wpf_AiSportsMicrospace/Views/Main.xaml
@@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.Views"
xmlns:gif="http://wpfanimatedgif.codeplex.com"
+ WindowStyle="None"
mc:Ignorable="d" WindowState="Maximized">