Improved Median filter MATLAB code and explanation ( without inbuilt function and with inbuilt function)
Improved Median filter MATLAB code and explanation ( without inbuilt function and with inbuilt function)
Modification:
Improved Median filter
Steps :
- Noise detection stage
- Noise correction stage i.e filtering stage
1. Noise detection stage
Steps:
2. Noise correction or filtering
Steps:
For second-row fourth column (figure 1 a):
1. 1.Taking surrounded pixel
[ 71, 69, 74, 70, 255, 66, 66, 66, 0]
2. Remove 0 and 255
[71, 69, 74, 70, 66, 66, 66]
3. Median filtering
[66, 66, 66, 69, 70, 71, 74]
Click here to download the full code
MATLAB Code: Improved median filter
Performance Results
Figure
2. (a) Resized gray input image, (b) 20 % salt and pepper noise added image,
(c) Both noise and filter are inbuild, (d) noise
user-defined; filter inbuilt, (e) improved filter user-defined; noise
inbuilt and (f) both are user-defined function improved filtered
outcome
From figure 2 we can say improved median filter (e and f) provide better performance when compared to inbuild command medfilt2 (c,d). Figure 2. e and f atmost looks like input image (a).
MSE | SSIM | PSNR | |
Both noise and filter are inbuild function | 17.9642 | 0.7254 | 27.9956 |
noise user-defined; filter inbuilt | 7.8526 | 0.8982 | 29.0505 |
filter user-defined; noise inbuilt | 21.1973 | 0.6574 | 24.696 |
both are a user-defined function | 7.9840 | 0.8988 | 29.0542 |
Comments
Post a Comment