本文整理汇总了C#中Microsoft.Kinect.Skeleton.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Skeleton.Select方法的具体用法?C# Skeleton.Select怎么用?C# Skeleton.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Kinect.Skeleton
的用法示例。
在下文中一共展示了Skeleton.Select方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Pruefe
/// <summary>
/// Prueft die history, ob die jeweilige Bewegung ausgelöst wird oder nicht.
/// </summary>
/// <param name="history">The history.</param>
/// <returns></returns>
public ErkennerStatus Pruefe(Skeleton[] history)
{
var headY = history.Select(x => x.Joints[JointType.Head].Position.Y);
var leftFootY = history.Select(x => x.Joints[JointType.FootLeft].Position.Y);
bool unten = (headY.Max() - headY.First() > 0.15) && (leftFootY.First() - leftFootY.Min()) < 0.02;
bool oben = (headY.First() - headY.Min() > 0.1) && (leftFootY.Max()-leftFootY.First()) < 0.02;
if (Blocked)
{
if (BlockStopwatch.ElapsedMilliseconds > 700)
{
Blocked = false;
BlockStopwatch = null;
}
}
if (!Blocked)
{
if (_geduckt && oben)
{
_geduckt = false;
MotionFunctions.SendAction(MotionFunctions.DownUp());
return ErkennerStatus.NichtAktiv;
}
if (!_geduckt && unten)
{
_geduckt = true;
MotionFunctions.SendAction(MotionFunctions.DownDown());
return ErkennerStatus.Aktiv;
}
}
return _geduckt ? ErkennerStatus.Aktiv : ErkennerStatus.NichtAktiv;
}
示例2: Pruefe
/// <summary>
/// Prueft die history, ob die jeweilige Bewegung ausgelöst wird oder nicht.
/// </summary>
/// <param name="history">The history.</param>
/// <returns></returns>
public ErkennerStatus Pruefe(Skeleton[] history)
{
var rightFootZ = history.Select(x => x.Joints[JointType.FootRight].Position.Z);
var rightFootY = history.Select(x => x.Joints[JointType.FootRight].Position.Y);
Ok = rightFootZ.Max() > rightFootZ.First() + 0.5 && (rightFootY.First() > rightFootY.Min() + 0.2);
return ErkennerHandler.SinglePress(this);
}
示例3: Pruefe
/// <summary>
/// Prueft die history, ob die jeweilige Bewegung ausgelöst wird oder nicht.
/// </summary>
/// <param name="history">The history.</param>
/// <returns></returns>
public ErkennerStatus Pruefe(Skeleton[] history)
{
var leftFootY = history.Select(x => x.Joints[JointType.FootLeft].Position.Y);
var rightFootY = history.Select(x => x.Joints[JointType.FootRight].Position.Y);
Ok = (leftFootY.First() - leftFootY.Min()> Paramters.JumpSchwelle) &&
(rightFootY.First() - rightFootY.Min() > Paramters.JumpSchwelle);
return ErkennerHandler.SinglePress(this);
}
示例4: Pruefe
/// <summary>
/// Prueft die history, ob die jeweilige Bewegung ausgelöst wird oder nicht.
/// </summary>
/// <param name="history">The history.</param>
/// <returns></returns>
public ErkennerStatus Pruefe(Skeleton[] history)
{
var leftHandZ = history.Select(x => x.Joints[JointType.HandLeft].Position.Z);
var leftHandY = history.Select(x => x.Joints[JointType.HandLeft].Position.Y);
var leftShoulderY = history.Select(x => x.Joints[JointType.ShoulderLeft].Position.Y);
var rightHandZ = history.Select(x => x.Joints[JointType.HandRight].Position.Z);
Ok = leftHandZ.First() < leftHandZ.Max() - 0.27 && (leftHandY.First() < leftShoulderY.First() + 0.1) && (rightHandZ.Max() - rightHandZ.First() < 0.15);
return ErkennerHandler.SinglePress(this);
}
示例5: Pruefe
public ErkennerStatus Pruefe(Skeleton[] history)
{
var rightHandZ = history.Select(x => x.Joints[JointType.HandRight].Position.Z);
var leftHandZ = history.Select(x => x.Joints[JointType.HandLeft].Position.Z);
Ok = (rightHandZ.Max() - rightHandZ.First() > Paramters.rhWieWeitNachVorneMitDenHaenden)
&& (leftHandZ.Max() - leftHandZ.First() > Paramters.rhWieWeitNachVorneMitDenHaenden)
&& (leftHandZ.First() - leftHandZ.First() < Paramters.rhWieParallelDieHaendeSeinSollten);
return ErkennerHandler.SinglePress(this);
}
示例6: Pruefe
/// <summary>
/// Prueft die history, ob die jeweilige Bewegung ausgelöst wird oder nicht.
/// </summary>
/// <param name="history">The history.</param>
/// <returns></returns>
public ErkennerStatus Pruefe(Skeleton[] history)
{
var rightFootX = history.Select(x => x.Joints[JointType.FootRight].Position.X);
var leftFootX = history.Select(x => x.Joints[JointType.FootLeft].Position.X);
bool rechts = rightFootX.Min() + Paramters.RlAktivierungsSchwelle < rightFootX.First() && (leftFootX.Max() - leftFootX.Min()) < Paramters.RlAndereFussLimite;
bool mitte = Math.Abs(rightFootX.First() - leftFootX.First()) < Paramters.RlMitteSchwellenwert;
if (_rechtsLaufend && mitte)
{
_rechtsLaufend = false;
MotionFunctions.SendAction(MotionFunctions.RightUp());
return ErkennerStatus.NichtAktiv;
}
if (!_rechtsLaufend && rechts)
{
_rechtsLaufend = true;
MotionFunctions.SendAction(MotionFunctions.RightDown());
return ErkennerStatus.Aktiv;
}
return _rechtsLaufend ? ErkennerStatus.Aktiv : ErkennerStatus.NichtAktiv;
}
示例7: RemoveUnusedMarkers
private void RemoveUnusedMarkers(Skeleton[] skeletons)
{
_skeletonTrackingIds.ForEach(id =>
{
if (!skeletons.Select(s => s.TrackingId).Contains(id))
{
var marker = canvas.FindName(BaseMarkerName + id) as Ellipse;
if (marker != null)
{
canvas.Children.Remove(marker);
}
}
});
}
示例8: Pruefe
/// <summary>
/// Prueft die history, ob die jeweilige Bewegung ausgelöst wird oder nicht.
/// </summary>
/// <param name="history">The history.</param>
/// <returns></returns>
public ErkennerStatus Pruefe(Skeleton[] history)
{
var rightHandY = history.Select(x => x.Joints[JointType.HandRight].Position.Y);
var rightHandX = history.Select(x => x.Joints[JointType.HandRight].Position.X);
var headX = history.Select(x => x.Joints[JointType.Head].Position.X);
var leftShoulderY = history.Select(x => x.Joints[JointType.ShoulderLeft].Position.Y);
Ok = rightHandX.First() < rightHandX.Max() - 0.2 && (rightHandY.First() > leftShoulderY.First()) && (rightHandX.First() < headX.First() - 0.2);
return ErkennerHandler.SinglePress(this);
}
示例9: k_SkeletonFrameReady
private void k_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
using (var s = e.OpenSkeletonFrame())
{
if (s == null)
return;
var t = e.OpenSkeletonFrame();
// No skeleton yet
if (t == null) return;
var v = new Skeleton[t.SkeletonArrayLength];
s.CopySkeletonDataTo(v);
// Find tracked heads
foreach (var head in
v.Select(sk => sk.Joints[JointType.Head]).Where(head => head.TrackingState != JointTrackingState.NotTracked))
{
// Move the laser and shoot!
_lastX = head.Position.X;
_lastY = head.Position.Y;
_lastZ = head.Position.Z;
// Nothing more to do
return;
}
}
}