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