I’ve implemented and tested all window functions that were described in the Taubin paper. It turned out that Blackman is even better. It has no oscillations and provides the correct scale within 10-20 iterations.
Smoothing result for passband=0.0, iterations changed between 1 to 300:
Hamming (original) - lot of oscillations in scale regardless of how many iterations we do:
Hanning - perhaps more oscillation for very low iteration count, but as the number of iterations grows, there is convergence to the correct size scale:
Blackman - no oscillations, immediately converges to the correct size scale:
I’ve tested on about other images with different passband and iterations and Blackman seems to be better than originally used Hamming for every case. I’m wondering if we should change the default window function to Blackman or keep the current inaccurate behavior by default.
There are a number of similar fixes in VTK that are not applied by default (vtkSelectPolyData::EdgeSearchMode, vtkProcrustesAlignmentFilter::StartFromCentroid) because they change the output, what existing users may not want. However, this means that all new users of VTK get suboptimal behavior by default. Is there some CMake flag or other mechanism that we could use to set defaults that lead to better results or better backward compatibility? I know about deprecation macros, but this is not exactly the same (we don’t need to force every users to change their software to use this new mode, existing users could still keep do what they have been doing, we would just want to change the default behavior for new users).