Kinect and colour mapping

edited December 2016 in Kinect

Hey guys, I'm using my kinect depth sensor with a fire burning script. It uses the kinect depth to affect the probability of burning I would like to use the kinect to create a series of colors between certain elevations. These colors should also correspond to certain land types that effect the probability of burning.

I have the script set up so far... based on an initial fire script but I am unsure of how to make the depth visible as colors.

This is what I wrote to use the kinect as a lattice that maps color values

void populateLatticeFromKinect() { // loop through kernels // for each kernel { for( int x = 0; x < lat1.w; x++ ){ // for( int y = 0; y < lat1.h; y++ ){ for( float x = 0; x < depthLat.w; x++ ){ for( float y = 0; y < depthLat.h; y++ ){

// depth = kinect depth at this point

         float depth =  depthLat.get((int)x,(int)y);

if (depth < 0.8 && depth >0.6){depth = FUEL; }

         depthLat.put((int) x,(int)y, depth );

// if(depth < 0.3 && depth > 0.15) { //set it to a value } } }

Ive attached the full script here... Also I have attached the intial script which I am working from. (I'm not sure if this will work) Any help would be greatly appreciated. I'm a novice coder and I'm still wrapping my head around the logic of processing.

Sign In or Register to comment.