Docsity

Median Filtering and Morphological Filtering: Image Processing Techniques, Essays (university) of Electrical Engineering

Partial preview of the text

Download Median Filtering and Morphological Filtering: Image Processing Techniques and more Essays (university) Electrical Engineering in PDF only on Docsity!

Median Filtering andMedian

Filtering and

Morphological Filtering

Yao Wang Polytechnic University, Brooklyn, NY 11201With contribution from Zhu Liu, Onur Guleryuz, andGonzalez/Woods, Digital Image Processing, 2ed

Lecture Outline

  • Median filterRank order filter• Rank order filter• Bilevel Morphological filters– Dilation and erosion– Opening and closing• Grayscale Morphological filtersYao Wang, NYU-Poly

EL5123: Non-linear Filtering

Median Filter: 3x3 Square Window 100 100 100

Wi d

100 200 205

Windowshape

100 100 100

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering

Matlab command: medfilt2(A,[3 3])

Median Filter: 3x3 Cross Window 100 100 100

Wi d

100 200 205

Windowshape

100 100 100

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering

Note that the edges of the centersquare are better reserved

Rank order filters

  • Rank order filtersInstead of taking the mean rank all pixel– Instead of taking the mean, rank all pixelvalues in the window, take the n-th ordervalue.value.– E.g. max or min or median• Properties• Properties– Non-linear T(f

+ f^ )^ ≠^ T(f 1 2

) + T(f) 1 2

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering

Multi-level Median Filtering • To reduce the computation, one can concatenate severalsmall median filters to realize a large window operation.• When the small windows are designed properly, thisapproach can also help reserve edges better.

Median Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering

Morphological Processing • Morphological operations are originallydeveloped for bilevel images for shape andstructural manipulations.• Basic functions are

dilation^

and^ erosion

-^ Concatenation of dilation and erosion in differentorders result in more high level operations,including

closing^

and^ opening

including

closing^

and^ opening

-^ Morphological operations can be used forsmoothing or edge detection or extraction ofother features.•^ Belongs to the category of spatial domain filter.Yao Wang, NYU-Poly

EL5123: Non-linear Filtering

Morphological Filtersfor Bilevel Images

g

  • A binary image can be considered as a setby considering “black” pixels (with imageby considering

black^

pixels (with image

value “1”) as elements in the set and“white” pixels (with value “0”) as outside

(^

)

the set. • Morphological filters are essentially setoperationsYao Wang, NYU-Poly^

EL5123: Non-linear Filtering operations

Basic Set Operations

  • Complement

Axand

Sxx

A^

 NOT

T^ l ti

A

A

A
NOT
A
  • Translation

Ayxy

zzA x

A

Translation

  • Reflection

ˆ^ :{

Axx

yyA 

A^

x Reflection A Origin^

A

Origin

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering

Dilation

  • Dilation of set F with a structuring elementH is represented by

HF

H is represented by

HF  } ˆ)(:{

 

FH xH F^

x

where^ Φ

represent the empty set.

-^

H is composed of all the points FG  that when^ Ĥ

shifts its origin to these points, at least one point of

Ĥ^ is included in F.

  • If the origin of H takes value “1”,

HF F^  Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering HF F^ 

Example of Dilation (2)

Note that the narrow ridge is closed H 3x3 origin at the center F^

G

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering H, 3x3, origin at the center

Erosion

  • Erosion of set F with a structuring elementH is represented by

and is defined H

F 

H is represented by

, and is defined as,

HF ^ })(:{ FHx

HF

-^

is composed of points that

:{ FHxH

F^

 x

H FG  when H is translated to these points, everypoint of H is contained in F.• If the origin of H takes value of “1”,

FH F^ 

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering

Example of Erosion (2)

H 3x3 origin at the center F^

G

Yao Wang, NYU-Poly^

EL5123: Non-linear Filtering H, 3x3, origin at the center

Structuring element

  • The shape, size, and orientation of thestructuring element depend on applicationstructuring element depend on application.• A symmetrical one will enlarge or shrinkthe original set in all directionsthe original set in all directions.• A vertical one, will only expand or shrinkthe original set in the vertical direction.Yao Wang, NYU-Poly

EL5123: Non-linear Filtering