Example #1
0
        public KinectTester()
        {
            InitializeComponent();

            sensor = new SmartKinectSensor();
            renderCanvas = new RenderCanvas(TimeSpan.FromSeconds(10));
            sensor.EnableSkeletonRenderingSensor();

            renderCanvas.ImageRendered += DisplayRenderedImage;

            capturedLabel.Visible = false;

            jointController = new JointController();
            gestureController = new GestureController();
            skeletonRender = new SkeletonRenderer(sensor.Sensor);

            sensor.SkeletonController.AddFunction(jointController);
            sensor.SkeletonController.AddFunction(gestureController);
            sensor.SkeletonController.AddFunction(skeletonRender);

            skeletonRender.SkeletonRendered += renderCanvas.SkeletonFrameCaptured;
            gestureController.GestureCaptured += GestureCaptured;
            jointController.JointTrackingCaptured += JointTrackingCaptured;

            ArduinoSerialPort serialPort = new ArduinoSerialPort("COM5", 115200);
            serialPort.Open();
            bodyTracker = new KinectBodyTracker(sensor, serialPort);

            GestureBuilderForm test = new GestureBuilderForm(sensor);
            test.Show();

            // InitializeArduino();
        }
Example #2
0
        public GestureBuilderForm(SmartKinectSensor sensor)
        {
            InitializeComponent();

            this.sensor = sensor;

            this.skeletonRenderer = new SkeletonRenderer(this.sensor.Sensor);
            this.timeSpan = TimeSpan.FromSeconds(10);
            this.renderCanvas = new RenderCanvas(timeSpan);
            this.skeletonRenderer.SkeletonRendered += renderCanvas.SkeletonFrameCaptured;
            this.renderCanvas.ImageRendered += new ImagingUtilities.ImageRenderedEventHandler(renderCanvas_ImageRendered);
            this.renderCanvas.ReplayCanvasComplete += new ImagingUtilities.ImageRenderingCompleteEventHandler(renderCanvas_ReplayCanvasComplete);
            this.sensor.SkeletonController.AddFunction(this.skeletonRenderer);

            this.recording = true;
            this.replaying = false;

            InitializeFormControls();
        }