Method of removing stains from digital images
A method of removing stains from digital images. First, the differences between a selected pixel and its adjacent pixels are computed. Those adjacent pixels with a difference greater than a first standard value are marked as special points. The special points of the selected pixel are enumerated. The selected pixel with a number of special points greater than a second standard value is marked as a stained pixel. Finally, the stained pixel is filled. Not only is the processing speed greatly increased, the stains on the image can be effectively removed.
1 . A method of removing stains from a digital image, comprising the steps of:
computing the difference between a selected pixel and its adjacent pixels;
marking the adjacent pixel as a special point if the difference is greater than a first standard value;
counting the number of the special points around the selected pixel;
marking the selected pixel as a stained pixel when the number of the special points is greater than a second standard value; and
filling the stained pixel.
2 . The method of claim 1 further comprising the step of converting the image to the YcbCr format.
3 . The method of claim 1 , wherein all of the adjacent pixels are the eight pixels surrounding the selected pixel.
4 . The method of claim 1 , wherein the first standard value is 7.
5 . The method of claim 1 , wherein the second standard value is 7.
6 . The method of claim 1 , wherein the selected pixel goes over all pixels in the image.
7 . The method of claim 1 , wherein the step of filling the pixel is implemented by filling the stained pixel the average of the adjacent pixels in the up, down, left, right direction from the stained pixel.
8 . The method of claim 1 , wherein the step of filling the pixel is implemented by filling the stained pixel the average of the eight adjacent pixels that surround the stained pixel.
9 . The method of claim 1 applied to the Windows operating system.
10 . The method of claim 1 applied to an embedded platform.