public FingerIdentification(KinectSensor sensor) { if(null != sensor) this.sensor = sensor; TrackingState = FingerTrackingState.NotTracked; Fingers = new Dictionary<FingerType, Finger>(); Fingers.Add(FingerType.ThumbRight, new Finger()); Fingers.Add(FingerType.IndexRight, new Finger()); Fingers.Add(FingerType.MiddleRight, new Finger()); Fingers.Add(FingerType.RingRight, new Finger()); Fingers.Add(FingerType.LittleRight, new Finger()); }
public FingerIdentification(KinectSensor sensor) { if (null != sensor) { this.sensor = sensor; } TrackingState = FingerTrackingState.NotTracked; Fingers = new Dictionary <FingerType, Finger>(); Fingers.Add(FingerType.ThumbRight, new Finger()); Fingers.Add(FingerType.IndexRight, new Finger()); Fingers.Add(FingerType.MiddleRight, new Finger()); Fingers.Add(FingerType.RingRight, new Finger()); Fingers.Add(FingerType.LittleRight, new Finger()); }
/// <summary> /// Finger Identify, sort by x_coordniate first,so many assumptions /// </summary> /// <param name="fingertips"></param> public void Identify(List<PointSkeleton3D> fingertips, int timeStamp) { if (null == fingertips) return; if (fingertips.Count == 5) //目前只能处理掌心比较标准的情况 { TrackingState = FingerTrackingState.Tracked; fingertips.Sort(CompareByCoord_X); Fingers[FingerType.MiddleRight].Position = fingertips[2]; Fingers[FingerType.MiddleRight].TrackingState = FingerTrackingState.Tracked; float dis1 = PointSkeleton3D.EuclideanDistance(fingertips[2], fingertips[0]); float dis2 = PointSkeleton3D.EuclideanDistance(fingertips[2], fingertips[4]); Fingers[FingerType.ThumbRight].Position = (dis1 > dis2 ? fingertips[0] : fingertips[4]); Fingers[FingerType.LittleRight].Position = (dis1 > dis2 ? fingertips[4] : fingertips[0]); Fingers[FingerType.ThumbRight].TrackingState = FingerTrackingState.Tracked; Fingers[FingerType.LittleRight].TrackingState = FingerTrackingState.Tracked; } FingerTrack(fingertips, timeStamp); }
/// <summary> /// Finger Identify, sort by x_coordniate first,so many assumptions /// </summary> /// <param name="fingertips"></param> public void Identify(List <PointSkeleton3D> fingertips, int timeStamp) { if (null == fingertips) { return; } if (fingertips.Count == 5) //目前只能处理掌心比较标准的情况 { TrackingState = FingerTrackingState.Tracked; fingertips.Sort(CompareByCoord_X); Fingers[FingerType.MiddleRight].Position = fingertips[2]; Fingers[FingerType.MiddleRight].TrackingState = FingerTrackingState.Tracked; float dis1 = PointSkeleton3D.EuclideanDistance(fingertips[2], fingertips[0]); float dis2 = PointSkeleton3D.EuclideanDistance(fingertips[2], fingertips[4]); Fingers[FingerType.ThumbRight].Position = (dis1 > dis2 ? fingertips[0] : fingertips[4]); Fingers[FingerType.LittleRight].Position = (dis1 > dis2 ? fingertips[4] : fingertips[0]); Fingers[FingerType.ThumbRight].TrackingState = FingerTrackingState.Tracked; Fingers[FingerType.LittleRight].TrackingState = FingerTrackingState.Tracked; } FingerTrack(fingertips, timeStamp); }
public Finger() { Position = new PointSkeleton3D(); TrackingState = FingerTrackingState.NotTracked; }
public Finger() { Position = new PointSkeleton3D(); TrackingState = FingerTrackingState.NotTracked; }