#include "Behaviors/StateMachine.h"
$nodeclass Depth : VisualRoutinesStateNode{
	$nodeclass GetDepth : VisualRoutinesStateNode : doStart{
		NEW_SKETCH(depthFrame, usint, sketchFromDepth());
		for(int x = 0; x<depthFrame.width; x++)
  			for(int y = 0; y<depthFrame.height-1; y+=2)
    				if(depthFrame[x+y*depthFrame.width]-depthFrame[x+(y+1)*depthFrame.width] < 10)
    				{
       					depthFrame[x+(y+1)*depthFrame.width] = 0;
       					depthFrame[x+y*depthFrame.width] = 0;
					
    				}
	}
	 $setupmachine{
		GetDepth
        }
}
REGISTER_BEHAVIOR(Depth);
