|
Input: The gray level gx,y of the pixel at the coordinates (x,y), the maximal value smax of the side of the square Us. |
|
Output: The noise removed value of the gray level
of the pixel in the coordinates (x,y). |
| Step 1: Assume that LA and LB are the two levels of noise pollution. |
| Step 2: Consider a s-neighborhood Us. Initially, we take s = 3. |
| Step 3: Calculate gmed, gmin, gmax as the median, minimal, and maximal gray level of the pixels in Us. |
| Step 4: Level LA. |
|
|
| Step 5: if (A11 > 0 && A12 < 0) then go to Step 11. |
| Step 6: else
s = s + 2 // We increase the size of s-neighborhood Us (s must be an odd number, as the pixel (x,y) must be in the center). |
| Step 7: end if
|
| Step 8: if
s ≤ smax
then go to Step 4. |
| Step 9: else Output:
. |
| Step 10: end if
|
| Step 11: Level LB. |
|
|
| Step 12: if (B11 ≥ 0 && B12 ≤ 0) then Output:
. |
| Step 13: else Output:
. |
| Step 14: end if
|