Commits

Cliff Biffle committed 3630228

KVAveragingDepthMap notices large Z changes and resets the pixel accumulator. This means it deals much better with motion, though it's still best for static images.

Comments (0)

Files changed (1)

KVAveragingDepthMap.m

       if (linear == 0.F) continue;
       
       float prev = out->z[y][x];
-      if (prev == 0.F) {
+      float delta = fabsf(linear - out->z[y][x]);
+      if (prev == 0.F || delta > 0.1F) {
         // If we've never gotten data for this point,
+        // or if it's changed substantially,
         // we take what we can get!
         out->z[y][x] = linear;
         sampleCount[y][x] = 1;