Optimal parameters for bilateral filtering and SAS image denoising