@@ -0,0 +1,1585 @@
+package com.haxademic.core.hardware.kinect;%0A%0Aimport com.haxademic.core.app.P;%0A%0Aimport processing.core.PGraphics;%0A%0Apublic class KinectUserDetection %7B%0A%0A%09protected KinectRegionGrid kinectRegionGrid;%0A%09protected PGraphics webcamBufferProcessed;%0A%0A%09public KinectUserDetection(int cols, int rows) %7B%0A%09%09// build detection grid%0A%09%09int KINECT_MIN_DIST = %09P.p.appConfig.getInt( %22kinect_min_mm%22, 500 );%0A%09%09int KINECT_MAX_DIST = %09P.p.appConfig.getInt( %22kinect_max_mm%22, 1000 );%0A%09%09int KINECT_TOP = %09%09P.p.appConfig.getInt( %22kinect_top_pixel%22, 0 );%0A%09%09int KINECT_BOTTOM = %09P.p.appConfig.getInt( %22kinect_bottom_pixel%22, KinectSize.HEIGHT );%0A%09%09int KINECT_PLAYER_GAP = P.p.appConfig.getInt( %22kinect_player_gap%22, 0 );%0A%09%09int KINECT_PIXEL_SKIP = P.p.appConfig.getInt( %22kinect_pixel_skip%22, 20 );%0A%09%09int PLAYER_MIN_PIXELS = P.p.appConfig.getInt( %22player_min_pixels%22, 10 );%0A%09%09kinectRegionGrid = new KinectRegionGrid(cols, rows, KINECT_MIN_DIST, KINECT_MAX_DIST, KINECT_PLAYER_GAP, KINECT_TOP, KINECT_BOTTOM, KINECT_PIXEL_SKIP, PLAYER_MIN_PIXELS);%0A%09%7D%0A%09%0A%09public void update() %7B%0A%09%09boolean debugging = P.p.showDebug;%0A%09%09kinectRegionGrid.update(debugging);%0A%09%09if(kinectRegionGrid.debugImage() != null) %7B%0A%09%09%09P.p.debugView.setTexture(kinectRegionGrid.debugImage());%0A%09%09%7D%0A%0A%09%09// draw active indicator%0A//%09%09P.p.debugView.setValue(%22KINECT USER ACTIVE%22, kinectRegionGrid.getRegion(1).isActive());%0A//%09%09int activeColor = kinectRegionGrid.getRegion(1).isActive() ? p.color(0,255,0) : p.color(255,0,0);%0A//%09%09pg.fill(activeColor);%0A//%09%09pg.rect(0,0, 100, 100);%0A%09%7D%0A%09%0A%09public void toggleDebug() %7B%0A%09%09kinectRegionGrid.toggleDebugOverhead();%0A%09%7D%0A%0A%7D

Add KinectUserDetection object