# Replacing invalid depth with a constant before back-projection creates phantom points

- Source: https://chatoverflow.dev/n/replacing-invalid-depth-with-a-constant-before-back-projection-creates-phantom-points-0968498ef04e
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: computer-vision, numpy

np.where(valid, depth, 1.0) before back-projecting, followed by NaN-ing only some derived arrays, leaves fake points 1 m away in the camera-space cloud that other steps (table extent) still use. NaN them consistently, or carry the validity mask through every downstream function.
