Morphological Image Processing

Post on 23-Feb-2016

442 Views

Category:

Documents

41 Downloads

Preview:

Click to see full reader

DESCRIPTION

Morphological Image Processing. Md. Rokanujjaman Assistant Professor Dept of Computer Science and Engineering Rajshahi University. What are Morphological Operations? . Morphological operations come from the word “morphing” in Biology which means “ changing a shape ”. Morphing. - PowerPoint PPT Presentation

Transcript

Morphological Image Processing

Md. RokanujjamanAssistant ProfessorDept of Computer Science and EngineeringRajshahi University

What are Morphological Operations?

Morphological operations come from the word “morphing”in Biology which means “changing a shape”.

Morphing

Image morphological operations are used to manipulateobject shapes such as thinning, thickening, and filling.

Binary morphological operations are derived fromset operations.

Basic Set Operations

Concept of a set in binary image morphology: Each set may represent one object. Each pixel (x,y) has its status: belong to a set or not belong to a set.

Translation and Reflection Operations

A

(A)z

z = (z1,z2)

Translation Reflection

B

BbbwwB for ,ˆ AazaccA z for ,

Logical Operations*

*For binary images only

Structuring Element

The two most common structuring elements (given a Cartesian grid) are the 4-connected and 8-connected sets, N4 and N8. They are illustrated in Figure .

Figure: The standard structuring elements N4 and N8.

Binary Images

For a binary image, white pixels are normally taken to represent foreground regions, while black pixels denote background. (Note that in some implementations this convention is reversed, and so it is very important to set up input images with the correct polarity for the implementation being used). Then the set of coordinates corresponding to that image is simply the set of two-dimensional Euclidean coordinates of all the foreground pixels in the image, with an origin normally taken in one of the corners so that all coordinates have positive elements.

Fundamental Morphological Operations

Erosion and dilation work (at least conceptually) by translating the structuring element to various points in the input image, and examining the intersection between the translated kernel coordinates and the input image coordinates.

For instance, in the case of erosion, the output coordinate set consists of just those points to which the origin of the structuring element can be translated, while the element still remains entirely `within' the input image.

Virtually all other mathematical morphology operators can be defined in terms of combinations of erosion and dilation along with set operators such as intersection and union. Some of the more important are opening, closing and skeletonization.

Fitting and Hitting

When we place a structuring element in a binary image, each of its pixels is associated with the corresponding pixel of the neighborhood under the structuring element. In this sense, a morphological operation resembles a “binary correlation”. The operation is logical rather than arithmetic in nature.

The structuring element is said to fit the image if, for each of its pixels that is set to 1 , the corresponding image pixel is also 1.

The structuring element is said to hit, an image if for any of its pixels that is set to 1, the corresponding image pixel is also 1.

Dilation Operations

ABzBA zˆ

A = Object to be dilatedB = Structuring element

= Empty setDilate means “extend”

Or BbAabazzBA ,

The dilation A by B is the set of all displacements z, such that reflection of B and A overlap by at least one element.

Dilation Operations (cont.)

StructuringElement (B)

Original image (A)

B̂Reflection

Intersect pixel Center pixel

Dilation Operations (cont.)

Result of Dilation Boundary of the “center pixels”where intersects A zB̂

Example: Application of Dilation

“Repair” broken characters

Erosion Operation

ABzBA z

A = Object to be erodedB = Structuring element

Erosion means “trim”

Or, BbxbzzBA every for

The erosion of A by B is the set of all points z such that B translated by z is contained in A

Erosion Operations (cont.)

StructuringElement (B)

Original image (A) Intersect pixel Center pixel

Erosion Operations (cont.)

Result of Erosion Boundary of the “center pixels”where B is inside A

Example: Application of Dilation and Erosion

Remove small objects such as noise

Duality Between Dilation and Erosion

BABA cc ˆ) (

Proof:where c = complement

BA

ABz

ABz

ABzBA

c

cz

ccz

cz

c

ˆ

) (

Opening Operation

BBABA ) (= Combination of all parts of A that can completely contain B

Opening eliminates narrow and small details and corners.

The process of erosion followed by dilation is called opening. It has the effect of eliminating small and thin objects, breaking the objects at thin points and smoothing the boundaries/contours of the objects.

Example of Opening

Closing Operation

BBBA )A(

Closing fills narrow gaps and notches

The process of dilation followed by erosion is called closing. It has the effect of filling small and thin holes, connecting nearby objects and smoothing the boundaries/contours of the objects.

Example of Closing

Example: Application of Morphological Operations

Finger print enhancement

Hit-or-Miss Transformation

)( XWAXAXA c *where X = shape to be detected W = window that can contain X

Hit-or-miss transform can be used for shape detection/ Template matching.

Hit-or-Miss Transformation (cont.)

)( XWABABA c *

Boundary Extraction

BAAβ(A)

Original image

Boundary

The boundaries/edges of a region/shape can be extracted by first applying erosion on A by B and subtracting the eroded A from A.

Region Filling

ckk ABXX 1

Original image

Results of region filling

where X0 = seed pixel p

Region filling can be performed by using the following definition. Given a symmetric structuring element B, one of the non-boundary pixels (X) is consecutively diluted and its intersection with the complement of A is taken as follows:

Terminates when Xk = Xk-1

Extraction of Connected Components

ABXX kk 1

where X0 = seed pixel p

Terminates when Xk = Xk-1

Convex Hull

i

iDAC

4

1)(

4,3,2,1 , 1 iABXX iik

ik *

iconv

i XD

Convex hull has no concave part.

Convex hull

Algorithm: where

Example: Convex Hull

Thinning

cBAA

BAABA

) (

) (

*

*

))...))((...(( 21 nBBBABA

Example: Thinning

Make an object thinner.

Thickening

* ) ( BAABA . ) )...) ) ((...(( 21 nBBBABA . . . .

Make an object thicker

*

Skeletons

Dot lines are skeletons of thisstructure

Skeletons (cont.)

)()(0

ASAS k

K

k

with

where ...) ) ) (...( ( BBBAkB)A

BkB)AkB)AASk ( ()(

k times

and kBAkK max

Skeletons

Thank You

top related