non-local-means: properly check number of parameters