RayAlign is a tool for aligning ray clouds either to each other or to coordinate axes. It performs rigid transformation alignment and can optionally apply non-rigid (quadratic) transformations for more complex alignment scenarios.
The rayalign tool can be used in two main modes: cross-alignment and self-alignment.
Aligns one ray cloud (raycloudA) onto another ray cloud (raycloudB) using rigid transformation:
rayalign raycloudA.ply raycloudB.ply [options]
raycloudA.ply: The source ray cloud to be aligned.raycloudB.ply: The target ray cloud to align onto.
This method requires approximately 30% or more overlap between the two clouds for successful alignment.
Aligns a ray cloud to coordinate axes, positioning major walls appropriately:
rayalign raycloud.ply
- Places major walls at (0,0,0) with the biggest wall aligned along the y-axis.
--nonrigidor-n: Applies non-rigid (quadratic) alignment instead of rigid transformation.--verboseor-v: Outputs additional debug information including FFT images and the coarse alignment cloud.--localor-l: Performs fine alignment only, assuming clouds are already approximately aligned.
The tool generates an aligned version of the input ray cloud with the suffix _aligned.ply. For cross-alignment, it outputs transformation details including:
- Rotation angles in degrees
- Translation vector
- Approximation notice for non-rigid transformations
Align cloud A onto cloud B with rigid transformation:
rayalign forest_scan1.ply forest_scan2.ply
Perform non-rigid alignment with verbose output:
rayalign scan1.ply scan2.ply --nonrigid --verbose
Axis-align a room scan to coordinate system:
rayalign room_scan.ply
Fine-tune alignment of pre-aligned clouds:
rayalign cloud1.ply cloud2.ply --local
- The alignment process uses FFT-based coarse alignment followed by fine alignment optimization.
- For more detailed information on command usage and implementation details, refer to the
RayAlignsource code atraycloudtools/rayalign/rayalign.cpp.