RGB Images: An Image Is A Matrix of Pixels Each Pixel Contains 3 Values (24 Bits) : Red, Green and Blue
RGB Images: An Image Is A Matrix of Pixels Each Pixel Contains 3 Values (24 Bits) : Red, Green and Blue
So the whole image is made of 3 different images for each color (components)
EXTRACT THE BLUE COMPONENT
The image is a 3D array width*height*3:
• red component: data(:, :, 1)
• green component: data(:, :, 2)
• blue component: data(:, :, 3)
PROCEDURE:
3 7 1 5 8 4 6
3 5 3 6 5 1 2 For every pixel in the image,
8 9 0 7 8 0 6 place the 3by3 mask centered
9 5 1 2 5 4 8 on it
0 3 6 9 7 8 5
6 3 5 8 6 9 1
2 8 6 4 5 6 7
MEDIAN FILTER
Pass a 3by3 mask over every pixel of the image and replace that pixel with the median.
Very good for noise removal and better than the Gaussian or Mexican hat filter at preserving edges.
PROCEDURE:
3 7 1 5 8 4 6
3 5 3 6 5 1 2 1: take values: 5 3 6 9 0 7 5 1 2
8 9 0 7 8 0 6 2: order values: 0 1 2 3 5 5 6 7 9
9 5 1 2 5 4 8 3: take the middle one: 5
0 3 6 9 7 8 5
6 3 5 8 6 9 1
2 8 6 4 5 6 7
MEDIAN FILTER
Pass a 3by3 mask over every pixel of the image and replace that pixel with the median.
Very good for noise removal and better than the Gaussian or Mexican hat filter at preserving edges.
PROCEDURE:
3 7 1 5 8 4 6
3 5 3 6 5 1 2 4: replace it in the image
8 9 5 7 8 0 6
9 5 1 2 5 4 8
0 3 6 9 7 8 5
6 3 5 8 6 9 1
2 8 6 4 5 6 7