public FramesCollector(TKinect.TKinect kinect, int framesCount = 20) { _framesCount = framesCount; _frames = new LinkedList<Frame>(); kinect.SkeletonFrameReady += OnSkeletonImageFrameReady; }
public FramesCollector(TKinect.TKinect kinect, int framesCount = 20) { _framesCount = framesCount; _frames = new LinkedList <Frame>(); kinect.SkeletonFrameReady += OnSkeletonImageFrameReady; }
public void Setup() { Configuration.postureNavigation = true; SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); Kinect = new TKinect.TKinect(); var framesCollector = new FramesCollector(Kinect, 30); PostureAnalyzer = new PostureAnalyzer(framesCollector, 25); PostureAnalyzer.PostureDetected += PostureAnalyzerOnPostureDetected; }
public HelloKinect() { //Initialize TKinect TKinect = new TKinect.TKinect(); //Initialize KinectToolBox frame collector SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); var framesCollector = new FramesCollector(TKinect, 30); //Create and use one of analyzers PostureAnalyzer = new PostureAnalyzer(framesCollector, 25); Configuration.postureNavigation = true; PostureAnalyzer.PostureDetected += PostureAnalyzerOnPostureDetected; }
private static void InitializeKinect() { int index = 0; KinectSensor kinectSensor = null; var testKinect = new TKinect.TKinect(); DependencyFactory.Container.RegisterInstance(testKinect); while (kinectSensor == null && index < KinectSensor.KinectSensors.Count) { try { kinectSensor = KinectSensor.KinectSensors[index]; kinectSensor.Start(); } catch (Exception) { kinectSensor = null; } index++; } if (kinectSensor != null) { kinectSensor.SkeletonStream.Enable(new TransformSmoothParameters { Smoothing = 0.5f, Correction = 0.5f, Prediction = 0.5f, JitterRadius = 0.05f, MaxDeviationRadius = 0.04f }); kinectSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30); kinectSensor.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30); kinectSensor.SkeletonFrameReady += testKinect.SensorSkeletonFrameHandler; kinectSensor.ColorFrameReady += testKinect.SensorColorFrameHandler; kinectSensor.DepthFrameReady += testKinect.SensorDepthFrameHandler; DependencyFactory.Container.RegisterInstance(kinectSensor); DependencyFactory.Container.RegisterInstance(testKinect); } }
static void Main(string[] args) { var tkinect = new TKinect.TKinect(); tkinect.SkeletonFrameHost.Start(4503); Application application = Application.Launch(@"..\..\..\HelloKinectWPF\bin\Debug\HelloKinectWPF.exe"); Window window = application.GetWindow("Hello Kinect", InitializeOption.NoCache); window.WaitWhileBusy(); var label = window.Get<TestStack.White.UIItems.Label>(SearchCriteria.ByAutomationId("Label")); var fileStream = new FileStream(RecordingPath, FileMode.Open); tkinect.ReplayStart(fileStream); Thread.Sleep(18000); var label2 = window.Get<TestStack.White.UIItems.Label>(SearchCriteria.ByAutomationId("Label")); application.Close(); fileStream.Close(); }
public static void InitKinectClient() { TKinect = new TKinect.TKinect(); //COLOR ColorDisplayHelper.Init(); TKinect.ColorFrameReady += ColorDisplayHelper.SensorColorFrameReady; //DEPTH DepthDisplayHelper.Init(); TKinect.DepthFrameReady += DepthDisplayHelper.SensorDepthFrameReady; //SKELETON SkeletonDisplayHelper.Init(); TKinect.SkeletonFrameReady += SkeletonDisplayHelper.SensorSkeletonFrameReady; //CLINET TKinect.ColorFrameClient.Connect("localhost",4501); TKinect.DepthFrameClient.Connect("localhost", 4502); TKinect.SkeletonFrameClient.Connect("localhost", 4503); }
public static void InitKinectClient() { TKinect = new TKinect.TKinect(); //COLOR ColorDisplayHelper.Init(); TKinect.ColorFrameReady += ColorDisplayHelper.SensorColorFrameReady; //DEPTH DepthDisplayHelper.Init(); TKinect.DepthFrameReady += DepthDisplayHelper.SensorDepthFrameReady; //SKELETON SkeletonDisplayHelper.Init(); TKinect.SkeletonFrameReady += SkeletonDisplayHelper.SensorSkeletonFrameReady; //CLINET TKinect.ColorFrameClient.Connect("localhost", 4501); TKinect.DepthFrameClient.Connect("localhost", 4502); TKinect.SkeletonFrameClient.Connect("localhost", 4503); }
public static void InitKinectHost() { //Initialize TKinect TKinect = new TKinect.TKinect(); //COLOR ColorDisplayHelper.Init(); TKinect.ColorFrameReady += ColorDisplayHelper.SensorColorFrameReady; //DEPTH DepthDisplayHelper.Init(); TKinect.DepthFrameReady += DepthDisplayHelper.SensorDepthFrameReady; //SKELETON SkeletonDisplayHelper.Init(); TKinect.SkeletonFrameReady += SkeletonDisplayHelper.SensorSkeletonFrameReady; //HOST TKinect.ColorFrameHost.Start(4501); TKinect.DepthFrameHost.Start(4502); TKinect.SkeletonFrameHost.Start(4503); }
static void Main(string[] args) { var tkinect = new TKinect.TKinect(); tkinect.SkeletonFrameHost.Start(4503); Application application = Application.Launch(@"..\..\..\HelloKinectWPF\bin\Debug\HelloKinectWPF.exe"); Window window = application.GetWindow("Hello Kinect", InitializeOption.NoCache); window.WaitWhileBusy(); var label = window.Get <TestStack.White.UIItems.Label>(SearchCriteria.ByAutomationId("Label")); var fileStream = new FileStream(RecordingPath, FileMode.Open); tkinect.ReplayStart(fileStream); Thread.Sleep(18000); var label2 = window.Get <TestStack.White.UIItems.Label>(SearchCriteria.ByAutomationId("Label")); application.Close(); fileStream.Close(); }
public void Setup() { Kinect = new TKinect.TKinect(); Kinect.SkeletonFrameHost.Start(4503); }