Applying median blur on an image in Matlab.
Median Blur is a technique of image processing whereby we apply a median value of a sub-array on a given pixel, with the specific pixel at the centre of the cells. So, here we specify the distance of farthest neighbour from the pixelated cell.
So, if we specify that the w value is 3, then by formula
2*w+1
a sub-array 7*7 will be considered for computation.
The higher the value of w will have negative consequences since it will mix a global range of pixels, similarly lower value of w will centralize the computation close to pixelated cell. Thus, an intermediate range of 2 to 4 needs to be chosen for varying results.- img will be the path of image in string
- w will be the neighboring value of median blur
Input Image | Output Image |
---|---|