Nodes/camera-comfyUI/PointCloudCleaner
ComfyUI Node

PointCloudCleaner

Sweeping the flying pixels out of your point cloud

By Alexankharin·Created about a year ago·Updated about a month ago· 36
PointCloudCleaner
  • pointcloud
  • cleaned_pointcloud
width1024
height1024
voxel_size1.00
min_points_per_voxel3

Depth-based point clouds are full of garbage. Along object silhouettes, where depth estimation is least certain, you get "flying pixels" - stray points floating in space that make rendered views look speckled and holes bigger than they should be. PointCloudCleaner is the pack's dedicated janitor: it removes isolated points via voxel filtering, so a cloud that looked like a noisy dust storm renders like an actual scene.

It's the point-cloud half of the cleanup story (the pack also has ProjectAndClean, which cleans via a projection mask; this one works in cloud space). You'll want to run it at a few places: right after DepthToPointCloud to knock out the worst silhouette noise, and again after you merge or enrich a cloud, since stitching new geometry in always drags along a fresh crop of orphans. The README's TODO list marks this exact job as done - "remove outlier and lonely points at depth borders" - so it's a mature, intended part of the pipeline, not a half-baked extra.

How it works

It projects the cloud through an identity camera into a fisheye-180° normalized UV plus depth, inverts the depth, and then voxelizes everything in (px, py, inverse-depth) space. Each voxel counts how many points land in it, and any point sitting in a voxel with fewer than min_points_per_voxel members gets dropped. Isolated pixels at depth borders land in sparse voxels by construction, so they go; real surface points cluster and survive.

The inputs that matter:

  • pointcloud - your N×7 tensor.
  • voxel_size - the voxel side length (default 1). This is your main tuning dial: smaller voxels = stricter "these points must be close together to count" test; larger voxels = gentler.
  • min_points_per_voxel - default 3. Raise it to remove more aggressively; lower it to keep borderline points.
  • width / height - default 1024 each. These are the resolution of the internal fisheye projection grid the voxelization runs in, not an output size - higher values give finer spatial bins.

The single output, cleaned_pointcloud, is the same N×7 tensor minus the removed points. N shrinks; the format doesn't change.

Installing it

Part of camera-comfyUI - install the pack once for all its nodes. Manager → Custom Nodes Manager → camera-comfyUI → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Alexankharin/camera-comfyUI.git
cd camera-comfyUI && python install.py

No optional dependencies needed.

Common issues

  • You cleaned away the actual surface - voxel_size too small or min_points_per_voxel too high. Back off and re-run; the whole point is removing isolated points, not thinning the surface.
  • Still speckly after cleaning - the remaining noise is usually from depth errors that cluster (e.g. along a whole silhouette). Pair with ProjectAndClean from a camera where those points are exposed, or mask them earlier via DepthEdgeFilter.
  • A huge cloud got slow - the voxelization samples for a quantile calculation and is built to scale, but a multi-million-point cloud will still take a moment. Nothing's wrong; it's just work.

Clean first, render after.

CategoryCamera/PointCloud

Inputs (5)

NameTypeDefaultDescription
pointcloudTENSOR
widthINT10241–16384
heightINT10241–16384
voxel_sizeFLOAT1.00
min_points_per_voxelINT3

Outputs (1)

NameTypeDescription
cleaned_pointcloudTENSOR