ai优化5
This commit is contained in:
parent
d1c3315029
commit
309c5678c4
@ -34,7 +34,7 @@ namespace Wpf_AiSportsMicrospace.Common
|
|||||||
private readonly CalcBaseRule _raiseLeftHandRule;
|
private readonly CalcBaseRule _raiseLeftHandRule;
|
||||||
private int _leftWaveCount = 0;
|
private int _leftWaveCount = 0;
|
||||||
private int _rightWaveCount = 0;
|
private int _rightWaveCount = 0;
|
||||||
private const int WaveThreshold = 2;
|
private const int WaveThreshold = 3;
|
||||||
WebcamClient _webcamClient;
|
WebcamClient _webcamClient;
|
||||||
|
|
||||||
private DateTime? _wristStartTime = null;
|
private DateTime? _wristStartTime = null;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
|
|||||||
private const double CardWidth = 368;
|
private const double CardWidth = 368;
|
||||||
private const double CardHeight = 534;
|
private const double CardHeight = 534;
|
||||||
private const double CardGap = 30; // 卡片之间水平间距
|
private const double CardGap = 30; // 卡片之间水平间距
|
||||||
private const double SlideDurationMs = 240; // 动画时长
|
private const double SlideDurationMs = 300; // 动画时长
|
||||||
private const double ProgressDurationMs = 2600;
|
private const double ProgressDurationMs = 2600;
|
||||||
|
|
||||||
public int SelectedIndex
|
public int SelectedIndex
|
||||||
|
|||||||
@ -64,8 +64,6 @@ namespace Wpf_AiSportsMicrospace.Views
|
|||||||
|
|
||||||
coverFlow.SelectedIndex = 0;
|
coverFlow.SelectedIndex = 0;
|
||||||
|
|
||||||
Loaded += Window_Loaded;
|
|
||||||
Unloaded += CenterHome_Unloaded;
|
|
||||||
//AnimationBehavior.SetSourceUri(LoadingImage, loadingImage);
|
//AnimationBehavior.SetSourceUri(LoadingImage, loadingImage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ namespace Wpf_AiSportsMicrospace
|
|||||||
private WavingAction _lastGestureAction = WavingAction.None;
|
private WavingAction _lastGestureAction = WavingAction.None;
|
||||||
private DateTime _lastMenuSlideTime = DateTime.MinValue;
|
private DateTime _lastMenuSlideTime = DateTime.MinValue;
|
||||||
private bool _isNavigating;
|
private bool _isNavigating;
|
||||||
private const int MenuSlideCooldownMs = 220;
|
private const int MenuSlideCooldownMs = 480;
|
||||||
|
|
||||||
public Home()
|
public Home()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,8 +60,6 @@ namespace Views.JumpLong
|
|||||||
public StandingLeap()
|
public StandingLeap()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += UserControl_Loaded;
|
|
||||||
Unloaded += UserControl_Unloaded;
|
|
||||||
_humanPredictor = HumanPredictorFactory.Create(HumanPredictorType.SingleHigh);
|
_humanPredictor = HumanPredictorFactory.Create(HumanPredictorType.SingleHigh);
|
||||||
_humanGraphicsRenderer = new HumanGraphicsRenderer();
|
_humanGraphicsRenderer = new HumanGraphicsRenderer();
|
||||||
_humanGraphicsRenderer.DrawLabel = false;
|
_humanGraphicsRenderer.DrawLabel = false;
|
||||||
|
|||||||
@ -71,8 +71,6 @@ namespace Wpf_AiSportsMicrospace.Views
|
|||||||
public GroupJumpRope()
|
public GroupJumpRope()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += UserControl_Loaded;
|
|
||||||
Unloaded += UserControl_Unloaded;
|
|
||||||
_groupJumpRopeContext = new GroupJumpRopeContext();
|
_groupJumpRopeContext = new GroupJumpRopeContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,9 +242,16 @@ namespace Wpf_AiSportsMicrospace.Views
|
|||||||
|
|
||||||
private async void StartCountdown(int start = 3)
|
private async void StartCountdown(int start = 3)
|
||||||
{
|
{
|
||||||
_mainWin.ShowCountDownAnimation();
|
if (_isCountdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_isCountdownStarted = true;
|
||||||
|
if (tipImage != null)
|
||||||
|
tipImage.Visibility = Visibility.Hidden;
|
||||||
|
|
||||||
//_currentCountdown = start;
|
//_currentCountdown = start;
|
||||||
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
||||||
|
_mainWin.ShowCountDownAnimation();
|
||||||
|
|
||||||
//开始人脸识别=============================================
|
//开始人脸识别=============================================
|
||||||
//Action<VideoFrame> handler = null;
|
//Action<VideoFrame> handler = null;
|
||||||
@ -281,9 +286,12 @@ namespace Wpf_AiSportsMicrospace.Views
|
|||||||
//_mainWin.FacialRecognitionEvent += handler;
|
//_mainWin.FacialRecognitionEvent += handler;
|
||||||
|
|
||||||
await Task.Delay(3000);
|
await Task.Delay(3000);
|
||||||
|
if (tipImage != null)
|
||||||
|
{
|
||||||
tipImage.Visibility = Visibility.Collapsed;
|
tipImage.Visibility = Visibility.Collapsed;
|
||||||
tipImage.Opacity = 0;
|
tipImage.Opacity = 0;
|
||||||
userBox.Children.Remove(tipImage);
|
userBox.Children.Remove(tipImage);
|
||||||
|
}
|
||||||
FinishCountdown();
|
FinishCountdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
Height="1080" Width="1920" Loaded="UserControl_Loaded">
|
Height="1080" Width="1920" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded">
|
||||||
<Grid>
|
<Grid>
|
||||||
<hc:Carousel IsCenter="True" AutoRun="True" Width="1920" Height="1080" VerticalAlignment="Center" Interval="3000">
|
<hc:Carousel IsCenter="True" AutoRun="True" Width="1920" Height="1080" VerticalAlignment="Center" Interval="3000">
|
||||||
<!--多人跳绳排行榜-->
|
<!--多人跳绳排行榜-->
|
||||||
|
|||||||
@ -36,8 +36,6 @@ namespace Views.JumpRope
|
|||||||
public TrainingRecords()
|
public TrainingRecords()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += UserControl_Loaded;
|
|
||||||
Unloaded += UserControl_Unloaded;
|
|
||||||
//_groupJumpRopeContext = new GroupJumpRopeContext();
|
//_groupJumpRopeContext = new GroupJumpRopeContext();
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,8 +54,6 @@ namespace Views.JumpingJack
|
|||||||
public BambooDragonfly()
|
public BambooDragonfly()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += UserControl_Loaded;
|
|
||||||
Unloaded += UserControl_Unloaded;
|
|
||||||
_groupJumpRopeContext = new GroupJumpRopeContext();
|
_groupJumpRopeContext = new GroupJumpRopeContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,9 +230,12 @@ namespace Views.JumpingJack
|
|||||||
private DateTime _lastUpdateTime = DateTime.Now;
|
private DateTime _lastUpdateTime = DateTime.Now;
|
||||||
private void StartCountdown(int start = 3)
|
private void StartCountdown(int start = 3)
|
||||||
{
|
{
|
||||||
_mainWin.ShowCountDownAnimation();
|
if (_isCountdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_isCountdownStarted = true;
|
||||||
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
||||||
|
_mainWin.ShowCountDownAnimation();
|
||||||
|
|
||||||
//开始人脸识别=============================================
|
//开始人脸识别=============================================
|
||||||
//Action<VideoFrame> handler = null;
|
//Action<VideoFrame> handler = null;
|
||||||
|
|||||||
@ -48,8 +48,6 @@ namespace Views.SquatFu
|
|||||||
public WhackAMole()
|
public WhackAMole()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += UserControl_Loaded;
|
|
||||||
Unloaded += UserControl_Unloaded;
|
|
||||||
_WhackAMoleContext = new WhackAMoleContext();
|
_WhackAMoleContext = new WhackAMoleContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,9 +224,15 @@ namespace Views.SquatFu
|
|||||||
|
|
||||||
private async void StartCountdown(int start = 3)
|
private async void StartCountdown(int start = 3)
|
||||||
{
|
{
|
||||||
_mainWin.ShowCountDownAnimation();
|
if (_isCountdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_isCountdownStarted = true;
|
||||||
|
if (tipImage != null)
|
||||||
|
tipImage.Visibility = Visibility.Hidden;
|
||||||
|
|
||||||
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
||||||
|
_mainWin.ShowCountDownAnimation();
|
||||||
//开始人脸识别 =============================================
|
//开始人脸识别 =============================================
|
||||||
//Action < VideoFrame > handler = null;
|
//Action < VideoFrame > handler = null;
|
||||||
|
|
||||||
@ -258,9 +262,12 @@ namespace Views.SquatFu
|
|||||||
// 绑定事件
|
// 绑定事件
|
||||||
//_mainWin.FacialRecognitionEvent += handler;
|
//_mainWin.FacialRecognitionEvent += handler;
|
||||||
await Task.Delay(3000);
|
await Task.Delay(3000);
|
||||||
|
if (tipImage != null)
|
||||||
|
{
|
||||||
tipImage.Visibility = Visibility.Collapsed; // 隐藏提示图片
|
tipImage.Visibility = Visibility.Collapsed; // 隐藏提示图片
|
||||||
tipImage.Opacity = 0;
|
tipImage.Opacity = 0;
|
||||||
userListBox.Children.Remove(tipImage);
|
userListBox.Children.Remove(tipImage);
|
||||||
|
}
|
||||||
FinishCountdown();
|
FinishCountdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user