RaySmooth is a tool for smoothing ray clouds by moving off-surface points onto their nearest surfaces. It reduces noise while preserving the overall geometric structure of the data.
raysmooth <raycloud_file>
<raycloud_file>: Input ray cloud file to smooth (.ply)
The smoothing algorithm works in two main steps:
- Calculates surface normals for each point
- Identifies 16 nearest neighbors for each point
- Determines local surface geometry and orientation
- Moves points along their normal direction
- Uses neighbor weighting based on normal similarity
- Preserves points that are already well-aligned with local surfaces
Points are adjusted using a weighted average of their neighbors, where:
- Weight decreases with normal direction differences
- More similar normals contribute more to the adjustment
- Central point weight prevents over-smoothing
Final adjustment projects the weighted centroid onto the local surface:
- Points move only along their surface normal
- Preserves tangential surface details
- Maintains overall geometric integrity
The tool generates a smoothed ray cloud with the suffix _smooth.ply.
- Remove scanning artifacts and noise
- Smooth irregular surfaces from low-quality sensors
- Improve point cloud quality for analysis
- Prepare data for meshing algorithms
- Improve surface continuity
- Reduce jagged edges in geometric features
- Clean data before feature extraction
- Improve results for surface-based algorithms
- Prepare for visualization and rendering
Smooth a noisy building scan:
raysmooth building_scan.ply
Clean up forest canopy data:
raysmooth forest_canopy.ply
Prepare data for mesh generation:
raysmooth terrain_scan.ply
The tool uses automatically determined parameters based on local geometry:
- Number of neighbors: 16 (fixed)
- Weighting scheme: Based on normal similarity
- No user-adjustable parameters required
The smoothing process preserves:
- Overall geometric structure
- Sharp geometric features (edges, corners)
- Ray timing and color information
- Bounded/unbounded ray classification
- Not compatible with
rayrestore: Geometric changes cannot be properly restored - Best suited for bounded rays (unbounded rays are skipped)
- May reduce fine surface detail in favor of smoothness
- Processes entire cloud in memory for efficiency
- Uses nearest neighbor search for local geometry analysis
- Suitable for medium to large datasets
- Single-threaded operation
- The algorithm automatically balances smoothing strength with detail preservation
- Surface normal quality directly affects smoothing results
- For more detailed information on smoothing algorithms, refer to the
RaySmoothsource code atraycloudtools/raysmooth/raysmooth.cpp.