Professional Documents
Culture Documents
March 26th Lecture
March 26th Lecture
Sxy
228 4 244
255 254 5
252 247 62
Adaptive median filter algorithm
Notations
3
Adaptive median filter algorithm
purpose
Remove salt and pepper noise,
To reduce distortion such as excessive thinning
or thickening of object boundaries
4
Adaptive median filter algorithm
5
A numerical example
255 241 251 255 16 245 245 255 244 239 255
250 255 255 0 255 244 255 254 254 6 255
238 253 255 255 255 254 255 229 246 251 238
255 252 240 245 228 4 244 255 255 255 251
1 247 252 250 255 254 5 244 243 233 250
12 251 245 255 252 247 6 253 255 239 255
255 255 1 252 246 251 255 254 248 240 246
251 254 249 234 255 245 255 239 255 0 255
254 240 255 254 242 255 243 252 251 252 251
255 15 255 254 7 254 254 248 242 255 250
247 244 255 228 246 235 1 245 1 251 246
Sxy
228 4 244
255 254 5
252 247 66
Sxy
228 4 244
254
255 (Zxy) 5
252 247 6
Zmed =244
Zmin=4,
Zmax=255
A1 = Zmed –Zmin =244 -4
A2 = Zmed –Zmax = 244 – 255
If A1 > 0 AND A2 < 0, go to stage B
B1 = Zxy – Zmin = 254 – 4 =250
B2 =Zxy – Zmax = 254 – 255 = -1
If B1 > 0 AND B2 < 0 output Zxy =254
7
Sxy
251 255 16
255 0 255
255 255 255
Zmed =255
Zmin=0,
Zmax=255
A1 = Zmed –Zmin =255 -0
A2 = Zmed –Zmax = 255 – 255
If A1 > 0 AND A2 < 0, go to stage B
B1 = Zxy – Zmin = 0 – 0 =0
B2 =Zxy – Zmax = 0 – 255 = -255
If B1 > 0 AND B2 < 0 output Zxy
Else Zmed
8
Sxy
254 242 255
254 7 254
228 246 235
Zmed =246
Zmin=7,
Zmax=255
A1 = Zmed –Zmin =246 -7
A2 = Zmed –Zmax = 246 – 255
If A1 > 0 AND A2 < 0, go to stage B
B1 = Zxy – Zmin = 7 – 7 =0
B2 =Zxy – Zmax = 7 – 255 = -248
If B1 > 0 AND B2 < 0 output Zxy
Else Zmed
9
An example of using adaptive median filter
10
Image compression
11
Need for image compression
Amount of data required to represent a two-hour
standard definition television movie using
720×480×24 bit pixel arrays
12
Image compression
Images occupy a large amount of space. A k-bit
image which has M x N pixels requires M x N x k
bits of storage space.
14
Image compression
15
The aim of coding is to reduce the amount of
redundancy in the message (image).
16
Redundancies in daily life:
Repetition in lecture:
17
Many of the compression techniques can be
applied to all kinds of information
18
An Example of various amounts of data used to
convey the same information :
19
How to measure Redundancy?
20
A code is a rule which assigns to each source
symbol a code word.
A 00001
B 00010
C 00011
D 00100
E 00101
21
Uniquely decodable code (UDC):
Example of a code which is not a UDC