Image smoothing scaled with local threshold