Wavelet Based Noise Variance Estimation and Its Application to Image Restoration