A symmetric hysteresis smoothing algorithm that preserves principal features