The invention relates to a method for removing salt-pepper noises in images, which comprises the following steps: A, identifying whether pi, j is a salt-pepper noise point; B, when the pi, j is a salt-pepper noise point, acquiring a 3*3 local window omega 3 centering on the pixel pi, j, and estimating a noise density d (omega 3) of the omega 3; C, when the noise density d (omega 3) obtained in the step B is less than 9, defining a filter output ri, j of the pi, j as follows: omega (fs, t, fi, j) = exp (-beta |fs, t - fi, j |); and D, when the noise density d (omega 3) obtained in the step B is equal to 9, defining the filter output ri, j of the pi, j as the steps in the specification. The invention aims to provide a method for removing salt-pepper noises in images, through which salt-pepper noise points in an area adjacent to some pixel can be removed better, so that adverse effects on the filter output of center pixels caused by noise points in local windows us reduced, and a more accurate filter output is obtained by using a new direction weighted average strategy.