N-D Curve Approximation
A coordinate-wise method for smoothing ordered multidimensional curves, with examples from 2D image contours to 3D trajectories.
The algorithm applies a coordinate-wise geometric transformation before parameterized spline smoothing, then restores the revised coordinate into the original representation.
Why standard coordinate-wise smoothing is difficult
The first illustration shows a practical 2D image-processing outcome: contours of lettering become cleaner after enhancement and smoothing. The following figures preserve the original 3D curve-approximation examples. These are different illustrations of geometric smoothing rather than one continuous data-processing pipeline.
Each coordinate may reverse direction, loop, or be locally non-monotonic. Treating a trajectory as a simple function of one geometric coordinate can therefore break when the same coordinate value occurs multiple times.
Instead of discarding the order of samples, the method maintains the ordered sequence and constructs a monotonic auxiliary path from the other coordinates.
Algorithm: unfolded cord
1. Choose the target coordinate
For each dimension in turn, one coordinate is selected for replacement and the others are used only to form an auxiliary parameterization.
2. Unfold the other coordinates
For each auxiliary dimension, accumulated absolute increments create a monotonic coordinate-like sequence. Small numerical adjustments handle repeated adjacent values before spline fitting.
3. Fit a parametric spline
A spline uses the transformed auxiliary dimensions and the original target coordinate. Only the smoothed version of the target coordinate is taken from the fit.
4. Update and continue
The replaced target coordinate is returned to the original point sequence, and the next dimension is processed. Smoothing strength and spline degree can be set individually for dimensions.
Point order, the original coordinate system, and the ability to process trajectories that turn back along axes.
Recovery of unordered point clouds, unconditional topology preservation, or a universal advantage over standard multidimensional splines.
Implementation and limitations
Preserved Python code includes smoothcnts.py and mylinessmoothdetector.py with coordinate-wise smoothing and SciPy/FITPACK spline routines. The code explores dimensionalities beyond 3D; the archived illustrations specifically document 3D trajectories.
No paired reference data, numerical error analysis or runtime benchmark is available. Default periodic spline settings suit closed trajectories and should not automatically be generalized to open ones.