The invention discloses a
stain detection method for a sensor of a
digital camera, and a method and a device for classifying the sensor of the camera based on the detection method, wherein the method comprises the following steps: (1) inputting original image data and obtaining luminance component via interpolation, (2) low-pass filtering, (3)
edge enhancement, (4) band-pass filtering, (5) image binaryzation operation and morphological dilation, (6)
connectivity area abstraction, (7) marking
stain in an original image, (8) classifying the sensor and outputting image level. The invention is divided as two function modules which are used for detecting the
stain and classifying the sensor. A contiguous item of a classification
decision function is from features such as quantity, area, and
color depth of the stain detected in a shooting image. The method and the device of the invention is simple and efficient and can be used for fast detecting stain position on the sensor and carrying out accurate level evaluation to
current sensor according to the feature of theses stains.