Skip to content

Instantly share code, notes, and snippets.

@whichlight
whichlight / kinect-depth-smoothing.js
Last active July 12, 2017 09:38
pixel smoothing and moving average in javascript, for Kinect depth frame buffers in https://github.com/whichlight/figure-sketching-kinect/
//from http://www.codeproject.com/Articles/317974/KinectDepthSmoothing
function smoothDepth(arr){
var res = createArray(width,height);
for(var i=2; i< width-2; i++){
for(var j=2; j < height-2; j++){
if(arr[i][j]===0){
var innerBandCount = 0;
var outerBandCount = 0;
var filterCollection = [];