I branched the code and modified ndv.cc to handle alpha layers. Mind taking a look? I'm not sure my approach was right, though it does work for me in my situation.
Also in my branch: some changes to use C++11 to avoid Boost references, changes to make the major ring and holes parameters work simultaneously, and an attempt to make erosion parameterizable.
Link: https://github.com/asirobots/dans-gdal-scripts