Info

This question is closed. Reopen it to edit or answer.

how to use this algorithm ? please tell me the coding i am new to matlab ..plz anyone help me with the coding.

1 view (last 30 days)
Step 1) A two dimensional square filtering window of size 3 x 3 is slid over a highly contaminated image.
Step2) The pixels inside the window are sorted out in ascending order.
Step 3) Minimum, maximum and median of the pixel values in the processing window are determined.Let the minimum, maximum and median pixel values, respectively, are 0, 255 and 255.
Step 4) If the central pixel lies between minimum and maximum values, then it is detected as an uncorrupted pixel and the pixel is left undisturbed. Otherwise, it is considered a corrupted pixel value. In the present case, the central pixel value 255 does not lie between minimum and maximum values. Therefore, the pixel is detected to be a corrupted pixel.
Step 5) The corrupted central pixel is replaced by the median of the filtering window, if the median value is not an impulse. If the median value itself is an impulse then the central pixel is replaced by the already processed immediate top neighbouring pixel Xi-1,j in the filtering window. In the present case, the median value is also an impulse and therefore, the pixel is replaced by its already processed top neighbour pixel value 214.

Answers (1)

Image Analyst
Image Analyst on 9 Oct 2014
Can you tell me how, in Step 4, a pixel value could NOT be between the max and the min in the window? Are you just considering the 8 outer pixels and not all 9 including the middle one? That was not stated - what it said was to look at all 9 pixels in the window.
The second sentence is step 3 also does not make any sense. The min, max, and median are what they are - you can't "let" them be what you want them to be. If the median is 82, it's 82 - I can't just say let's pretend it's 255, otherwise why even bother computing the median?
I've attached a similar thing which is a modified median filter. What you need should be fairly similar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!