Search code examples
image-processingpython-3.xnoise-reduction

cleaning salt and pepper noise


I have the following image (it's a license plate) and it was affected by salt and pepper noise of 0.9 probability (each pixel had 90% chance to turn completely white or completely black). I need to clean it as best as possible inorder to nmake the number readable. I have the basic allowed algorithms in Python but changes are allowed - and I need to somehow make the image clear. We turn the image into a black and white bitmap of pixels that are loaded into a matrix and we perform all the algorithms directly on the matrix. We use 2 variations of medians - I have tried many combinations of them both to no avail - no clear picture was produced. I desperately need help!

The code and the image are in this location in skydrive: http://sdrv.ms/1az6sRC in order to use the code Python 3.2 is nessesary and the add-on in the directory needs to be installed in order to present images in Python. The class matrix needs to be imported, and the file cleaning.py with the function clean contains my attempts - this function can use any of the code in the file (with variations) in order to achieve as good as possible result.

Any help will be appreciated.


Solution

  • Traditional salt and pepper image de-noising filter are suited when the noise probabilty is say about 40% (the probability of an image pixel being flipped). In your case, you have a density noise. You will need to use a computationally more expensive median-based filter to solve the problem. On closer looks at the results of this paper , it seems achievable, but you will need to implement it.