1. A method for image denoising based on median filter, comprising: selecting three groups of pixels from neighboring pixels of a current pixel, calculating medians Φ 1 , Φ 2 and Φ 3 for the three groups of pixels, respectively; calculating a reference luminance Y: Y=Φ 2 +[Φ 1 +Φ 3 −2*Φ 2 ]*h*[1−k*var], where var=Φ 3 −Φ 1 and h, k are two adjustable parameters for controlling denoising intensity; determining whether the current pixel (cur_pixel) is a bad pixel; letting a temporary variable be Φ 1 (tmp_data=Φ 1 ) if the current pixel is a bad pixel; letting a temporary variable be the current pixel value (tmp_data=cur_pixel) if the current pixel is not a bad pixel; determining whether the current pixel is located on an edge; limiting the reference luminance Y to a range of [tmp_data−edge_limit, tmp_data+edge_limit] and updating the current pixel value (cur_pixel) with the limited reference luminance Y if the current pixel is determined to be located on the edge, where edge_limit is a luminance adjusting parameter within a range of 0˜255; the denoising process ends; comparing the value of |Y−tmp_data| and the value of avoid_over_noise if the current pixel is determined not to be located on the edge, where avoid_over_noise is an adjustable parameter indicating a threshold for preventing over-denoising; updating the current pixel value with the reference luminance Y if |Y−tmp_data−<avoid_over_noise; updating the current pixel value with the temporary variable (tmp_data) if |Y−tmp_data|≧avoid_over_noise; and repeating the above steps for each pixel in the image.