A method of correcting a defective pixel of a digital image, comprising: pre-correcting the defective pixel, using a conventional averaging method or a nearest neighbor method; calculating similarities between a plurality of normal pixels and the defective pixel, wherein the plurality of normal pixels are normal pixels in a neighborhood centered on the defective pixel; calculating weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel; and normalizing the weights and adopting a weighted sum of values of the normal pixels according to the normalized weights as a corrected value of the defective pixel, wherein the calculating similarities between the plurality of normal pixels and the defective pixel comprises: calculating the similarities between the normal pixels and the defective pixel based on a neighborhood similarity by the following equation: D P i P j = ‖ U R P i − U R P j ‖, where P i represents the defective pixel; P j represents a normal pixel neighboring the defective pixel P i; and D(P i, P j) is a distance representing a similarity between the pixels P i and P j, where the greater the distance is, the lower the similarity becomes, and the lower the weight becomes; and U R (P i) represents a neighborhood of the defective pixel P i, which is a matrix having a size of 2R+1 centered on the defective pixel P i; the method being characterized in that the calculating weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel comprises: calculating a weight W i,j of the normal pixel to the defective pixel by the following equation: W i, j = e − D 2 P i P j σ 2, or W i, j = − σ 1 + D P i P j wherein σ is a constant, and D(P i, P j) represents the similarity of the normal pixel to the defective pixel. pre-correcting the defective pixel, using a conventional averaging method or a nearest neighbor method; calculating similarities between a plurality of normal pixels and the defective pixel, wherein the plurality of normal pixels are normal pixels in a neighborhood centered on the defective pixel; calculating weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel; and normalizing the weights and adopting a weighted sum of values of the normal pixels according to the normalized weights as a corrected value of the defective pixel, wherein the calculating similarities between the plurality of normal pixels and the defective pixel comprises: calculating the similarities between the normal pixels and the defective pixel based on a neighborhood similarity by the following equation: D P i P j = ‖ U R P i − U R P j ‖, where P i represents the defective pixel; P j represents a normal pixel neighboring the defective pixel P i; and D(P i, P j) is a distance representing a similarity between the pixels P i and P j, where the greater the distance is, the lower the similarity becomes, and the lower the weight becomes; and U R (P i) represents a neighborhood of the defective pixel P i, which is a matrix having a size of 2R+1 centered on the defective pixel P i; the method being characterized in that the calculating weights of the plurality of normal pixels to the defective pixel based on the similarities between the plurality of normal pixels and the defective pixel comprises: calculating a weight W i,j of the normal pixel to the defective pixel by the following equation: W i, j = e − D 2 P i P j σ 2, or W i, j = − σ 1 + D P i P j wherein σ is a constant, and D(P i, P j) represents the similarity of the normal pixel to the defective pixel.