Skip to content

Instantly share code, notes, and snippets.

@miclaus
Last active April 4, 2017 16:39
Show Gist options
  • Save miclaus/1af01e607995053be0c8 to your computer and use it in GitHub Desktop.
Save miclaus/1af01e607995053be0c8 to your computer and use it in GitHub Desktop.
if ( c == 0 ) {
try {
if ( ! circlePoint.isDocked()
&& depthValues[i] >= minDist
&& depthValues[i] < cpDepth
) {
circlePoint.setDocked(true);
circlePoint.setDepth(depthValues[i]);
}
else if ( circlePoint.isDocked()) {
for (int xCount = x - posThresh; xCount <= x + posThresh; xCount++) {
for (int yCount = y - posThresh; yCount <= y + posThresh; yCount++) {
int threshIndex = xCount + (yCount * kinectWidth);
int threshDepth = depthValues[threshIndex];
if ( threshDepth >= cpDepth + depthThresh
&& threshDepth <= cpDepth - depthThresh
) {
x = xCount;
y = yCount;
break;
}
}
}
// if ( depthValues[i] >= maxDist )
// circlePoint.resetDocked();
}
// println("> " + indexX + "x" + indexY + " / " + i + " = " + depthValues[ i ] + " == " + circlePoint.getDepth());
}
catch (Exception ex) {
println("†");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment