Title: Mean and Median Filters
1Mean and Median Filters
- ???????
- ???????
- ??E9406011
2Outline
- Introduction
- Mean Filter
- Median Filter
- Summary
- Demo
3Introduction
- ????????
- ???(frequency domain) ???????? ?? (????,
??) -
?????????? - ???(spatial domain) ??????? pixel value ???
?????????
g(x,y) T f(x,y) f(x,y) ?????? g(x,y)
???????? T -gt???????
4Introduction
- ???????( ??? g(x,y) T f(x,y) )
Original
Original
y
y
(x,y)
(x,y)
Image f(x,y)
Image g(x,y)
x
x
g(x,y) T f(x,y) f(x,y) ?????? g(x,y)
???????? T -gt???????
5Outline
- Introduction
- Mean Filter
- Median Filter
- Summary
- Demo
6Mean Filter
- The Mean Filter is used to
- soften an image by averaging surrounding pixel
values.
7Mean Filter
Grayscale 3x3 pixel window
22 77 48
150 77 158
0 77 219
(x,y)
Center pixel ( 22 77 48 150 77 158
0 77 219 ) / 9 92
8Mean Filter
(a) ?????????? (b) ??????????? (c)
?????????? (d) ???????????
9Mean Filter
int x , y int a(n-1)/2 int
color(i) , color(x,y) for(int kx-a kltxa
k) for(int my-a mltya
m) color(x,y)color(k,m) color(i)co
lor(x, y)/nn)
10Mean Filter
Header file included include
itkMeanImageFilter.h Using Typedef
ItkMeanImageFilter lt
InputImageType, OutputImageType gt FilterType
FilterTypePointer filter
FilterTypeNew(() InputImageTypeSizeType
indexRadius indexRadius0 1 // radius
along x 1-gt 2D 2-gt 35 indexRadius1 1
// radius along y Rx 2 1 2 1
1 3 Rx ?? x ?????, 1 ????? Ry 2 1
2 1 1 3 Ry ?? y ?????, 1 ?????
11Mean Filter
Mean
Source
12Mean Filter
Source
Mean
13Outline
- Introduction
- Mean Filter
- Median Filter
- Summary
- Demo
14Median Filter
- The Median filter is used to
- remove noise from an image
- by replacing pixels with the middle pixel
value selected from a certain window size.
15Median Filter
Grayscale 3x3 pixel window
22 77 48
150 77 158
0 77 219
(x,y)
0, 22, 48, 77, 77 , 77, 150, 158, 219
16Median Filter
(a) ?????????? (b) ??????????? (c)
?????????? (d) ???????????
17Median Filter
int x , y int z0 int a(n-1)/2 int color(i)
int array new int nxn-1 for(int kx-a
kltxa k) for(int my-a mltya
m) array zcolor(k,m) z sort(ar
ray) color(i)median(array )
18Median Filter
Header file included include
itkMedianImageFilter.h Using Typedef
ItkMedianImageFilter lt
InputImageType, OutputImageType gt FilterType
FilterTypePointer filter
FilterTypeNew(() InputImageTypeSizeType
indexRadius indexRadius0 1 // radius
along x 1-gt 2D 2-gt 35 indexRadius1 1
// radius along y
19Median Filter
33 median filtering
Source
20Median Filter
Source
33 median filtering
99 median filtering
21Outline
- Introduction
- Mean Filter
- Median Filter
- Summary
- Demo
22Summary
- Mean filter and Median filter??? - 1
23Summary
- Mean filter and Median filter??? - 2
Mean filter
Median filter
24Summary
- Mean filter and Median filter??? - 3
(c) ???????
25Outline
- Introduction
- Mean Filter
- Median Filter
- Summary
- Demo
26Demo
27Demo
28????
- ItkSoftwareGuide.pdf
- http//www.cee.hw.ac.uk/hipr/html/mean.html
- http//www.ntut.edu.tw/s9598008/homework1.htm
- http//www.cc.ntut.edu.tw/s8410010/hw1.htm
- ???,??????,??????(SIM 949)?
- http//140.128.102.71/ ?????????????
29