Image Filtering
-
Upload
mohamedtarek -
Category
Documents
-
view
221 -
download
1
description
Transcript of Image Filtering
![Page 1: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/1.jpg)
Image Filtering
Purpose:
–Image Enhancement
–Noise Removal
–Edge Enhancement/Detection
![Page 2: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/2.jpg)
• An image is a matrix of points called pixels
• Resolution
– 640 X 480 ( 0.3 MegaPixels)
– 1600 X 1200 ( 2 MegaPixels)
– 3872 X 2592 (10 MegaPixels)
• Grayscale: generally 8 bits per pixel Intensities in range
[0…255]
• RGB color: 3 of 8-bit color planes: IR , IG , IB
Images
![Page 3: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/3.jpg)
Example of a grayscale image intensity I(x,y)
(0 = black, 255 = white)
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 20 0 255 255 255 255 255 255 255
255 255 255 75 75 75 255 255 255 255 255 255
255 255 75 95 95 75 255 255 255 255 255 255
255 255 96 127 145 175 255 255 255 255 255 255
255 255 127 145 175 175 175 255 255 255 255 255
255 255 127 145 200 200 175 175 95 255 255 255
255 255 127 145 200 200 175 175 95 47 255 255
255 255 127 145 145 175 127 127 95 47 255 255
255 255 74 127 127 127 95 95 95 47 255 255
255 255 255 74 74 74 74 74 74 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
Images
=
x
y
![Page 4: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/4.jpg)
r s t
u v w
x y z
Origin x
y Image I (x, y)
eprocessed = v*e + r*a + s*b + t*c + u*d + w*f + x*g + y*h + z*i
Filter Simple 3*3
Neighbourhood e
3*3 Filter
a b c
d e f
g h i
Original Image
Pixels
*
This process is called convolution and is repeated for every pixel in the original image to get the filtered image
Image Spatial Filtering
![Page 5: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/5.jpg)
Simply average all of the pixels in a neighbourhood around a central value
1/9 1/9 1/9
1/9 1/9
1/9
1/9 1/9
1/9
Mean Smoothing Filters
sum of filter values = 1
![Page 6: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/6.jpg)
Example
8 5 8 8 5 8
8 5 8 8 5 8
8 5 8 8 5 8
1
9
1 1 1
1 1 1
1 1 1
7 7 7 7 7 7
7 7 7 7 7 7
7 7 7 7 7 7
Mean Smoothing Filters
![Page 7: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/7.jpg)
Image smoothed with mean filters
Original 33 99
Mean Smoothing Filters
![Page 8: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/8.jpg)
Pixels closer to the central pixel are more important
1/16 2/16
1/16
2/16 4/16
2/16
1/16 2/16
1/16
Gaussian Weighted Filter
Weighted Smoothing Filters
sum of filter values = 1
![Page 9: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/9.jpg)
Gaussian
Original image
Mean
Weighted Smoothing Filters
![Page 10: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/10.jpg)
Example
6 7
3 7 8
2 3
4 6 7
2, 3, 3, 4, 6, 7, 7, 7, 8
Median Smoothing Filters
![Page 11: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/11.jpg)
Noisy image 5x5 median filter 5x5 mean filter
Median Smoothing Filters
![Page 12: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/12.jpg)
1 1 1 1 1 1 1 1 1
0 0 0 0 2 0 0 0 0
-
Edge Enhancement (Sharpening)
sum of filter values = 1
![Page 13: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/13.jpg)
• Convert a 2D image into a set of curves
• Extracts salient features of the scene
Edge Detection
![Page 14: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/14.jpg)
• Directional Edge Detection
• Simple mask for:
– horizontal edges
– vertical edges
-1 1
-1
1
Edge Detection
sum of filter values = 0
![Page 15: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/15.jpg)
Sobel Filter is a combination of 2 filters:
the combined image will show edges from both directions
-1 0 1
-2 0 2
-1 0 1
-1 -2 -1
0 0 0
1 2 1
Sobel Edge Detection
xI yI
2 2
x yI I
![Page 16: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/16.jpg)
Sobel Edge Detection
xI yI 2 2
x yI I
![Page 17: Image Filtering](https://reader034.fdocuments.us/reader034/viewer/2022051316/5695d2f01a28ab9b029c3fee/html5/thumbnails/17.jpg)
x
y Image I(x, y)
e
At the borders of an image we are missing pixels to form a neighbourhood
• Truncate the image
• Replicate border pixels
• Pad the image (with either
all white or all black pixels)
Dealing with Borders