53
1 Representation And Description Digital Image Processing Presentation By: Slimane Rechoum

Representation \u0026 Description

Embed Size (px)

Citation preview

1

Representation And Description

Digital Image Processing

Presentation

By: Slimane Rechoum

2

Introduction

• After segmentation, the image needs to bedescribed and interpreted.

• Representation: an object may be represented byits boundary.

• Description: the object boundary may bedescribed by its length, orientation, or number ofconcavities...

3

Representation

An object can be represented by:

• its external characteristics, such as its boundary.

• Or its internal characteristics, such as its texture.

4

Description

• The features that represent the image areused as descriptors.

• Descriptors should not be sensitive tovariations like :– Size Change

– Translation

– Rotation

5

Representation Schemes

A digital boundary of an image is superimposedwith a grid.

The boundary points are approximated to thenearest grid point. Then a sampled image isobtained. From a selected starting point, a chaincode can be generated by using a 4-directional oran 8-directional chain code. These refer to 4- and8-connectivity respectively.

Chain Codes

6

Chain Codes

The method has the main followingdisadvantages:

• The chain of codes is too long.

• Even slightly disturbed code would notreconstruct original image.

71101101030332330322212

22120207656764443

1 3 2 1

40

5 6 74

2 0

Four Directional Chain Code Eight Directional Chain Code

8

Polygonal Approximation

The goal of a polygonal representation is tocapture the essence of the boundary shape of animage.

The boundary can be thought of as a rubber band,which when it shrinks, gives the minimumperimeter polygon.

9

Signatures

A signature is a one-dimensional functionthat represents the boundary shape. Onesimple way to generate it is to plot thedistance from the centroid. The followingfigure gives an example.

10

Boundary Segments

Partitioning the boundary into segments reducesits complexity thus simplifying is description. Apowerful way to decompose boundaries thatcontain significant concavities is the Convex Hull.It is the smallest convex surface that encloses theobject.

11

The Convex Hull

If S is the figure surface and H is the convex hullsurface, H-S is called the convex deficiency. Theboundary is partitioned at the points of deviationbetween the boundaries of S and H.

This concept is useful to describe both an entireregion and its boundary.

12

The Skeleton of a Region

• The skeleton of a region reduces a plane region toa graph. The process to produce the skeleton iscalled thinning or skeletonizing.

• By definition, the skeleton of a region is the set ofpoints from the surface that have more than oneclosest neighbor form the border.

• This transformation is called The Medial AxisTransformation (MAT).

13

Boundary Descriptors

Some Simple Descriptors:

• The length of the boundary

• The curvature: the rate of change of the slope.

14

Shape Numbers

• Based on 4-directional-chain code, the shapenumber is the first difference of the smallestmagnitude. The number of digits in the shapenumber is the called the order.

• The shape number can also be defined using 8-directional-chain code

15

The N Cartesian coordinates (xi, yi) of a digital boundary can be represented as:

s(k) = x(k) + j.y(k) for k=0 to N-1.

The DFT of s(k):

for u=0 to N-1.

The complex coefficients a(u) are called the Fourier Descriptors of the boundary.

Then s(k) can be written as:

for k=0 to N-1.

Fourier Descriptors

NukN

k

eksN

ua /21

0

)(1

)( π−−

=∑=

∑−

=

=1

0

/2)()(N

u

Nukjeuaks π

16

Since the high frequency DFT components of s(k)only account for details, the Fourier seriesrepresentation of s(k) can be truncated to M < Nelements, resulting in the approximation :

for k=0 to N-1.

Fourier Descriptors

∑−

=

=1

0

/2)()(ˆM

u

Nkjeuaks π

s

17

Fourier Descriptors

Note that it still represents all N points ofthe boundary, however, with less Fouriercomponents.

18

Moments

The Moment Representation Theorem [1]:

The infinite set of moments {mp,q ,p,q=0,1,…}uniquely determines f(x,y) and vice versa.

19

Moment-Based Features

• Center of mass

• Orientation: defined as the angle of axis aroundwhich the moment of inertia is the least.

• Bounding rectangle: defined as the smallestrectangle that encloses the object wile aligned withits axis.

• Best-fit ellipse: defined as the ellipse with thesame second moments as the object.

20

Moment-Based Features (cont’d)

• Eccentricity: is either

– The ratio between the radii of the best-fit ellipse, or

– The ratio between the minimum and maximummoments of inertia.

21

Regional Descriptors

Some Simple Descriptors

• The Area

• The Perimeter

• The Compactness = perimeter2/Area

22

Topological Descriptors

• The Number of Holes: H

• The number of Connected Elements: C

• Euler’s Number = C – H

23

The Euler’s Formula

For regions represented by straight lines alsocalled polygonal networks the followingparameters are defined:

• W: the number of vertices

• Q: the number of edges

• F: the number of faces

• The Euler’s Formula: W - Q + F = C – H = E

24

Texture

Texture is an important part of region. Therefore,quantifying it is an interesting approach to itsdescription. Some properties of a textures are:

• Smoothness

• Coarseness

• Regularity

(Analogy with noise: uniformity, bandwidth, andperiodicity…)

25

Texture

There are three major ways to describe atexture:

• Statistical

• Structural

• Spectral

26

Statistical Approaches

• Characterize the texture as smooth, coarse,and grainy…

• Uses moments of the image histogram todescribe texture.

27

Structural Approaches

• Based upon finding the elementaryrepetitive structure called Texture Primitive.

• The primitive is repeated according to arule to generate the texture.

28

Spectral Approaches

• Fourier spectrum is particularly suited to periodicor semi-periodic shapes.

• Three important things can be done using Fourierspectrum:– Dominant peaks of the spectrum show the main texture

feature direction.

– Depict the fundamental spatial period of the texturefrom the peaks frequency.

– Isolate non-periodic objects by filtering out periodiccomponents of the spectrum.

29

Moments

• A set of invariant moments can be derivedto describe the texture.

• Moments are invariant to translation,rotation, and scaling.

30

Morphology

• Morphology is used in a mathematical context astool to extract image components. Those caneither be boundaries, skeletons, or the convex hull.

• Concepts of set theory are used. This approach isparticularly powerful in numerous image-processing situations.

31

Dilation and Erosion

Dilation and erosion are the basis for mostother morphological operations.

32

Some Basic Definitions

• Translation: A is translated by x is denoted by(A)x and defined as:

(A)x={c|c = a+x, for a ∈ A}

• Reflection: B’ is the reflection of B is defined as:B’ = {x|x = -b, for b∈B}

33

Some Basic Definitions

• Complement: Ac, the complement of A is definedas:

Ac = {x|x ∉ A}

• Difference: A-B, the difference between the sets Aand B is defined as:

A-B = {x|x ∈ A, x ∉ B}

34

Dilation

Dilation of A by B is defined as:

A⊕B={x|(B’) x ∩ A ≠ ∅}

B is called the structuring element.

35

Erosion

Erosion of A by B is defined as:

A Θ B ={ x|(B) x ⊆ A }

36

Opening and Closing

• Opening:

The opening of set A by the structuring element Bis defined by:

A ο B = ( A Θ B ) ⊕ B

which is simply A dilated and then eroded by B.

This smoothens out contours, and eliminatesisthmuses and protrusions.

37

• Closing:

The closing of set A by the structuring element Bis defined by:

A • B = ( A ⊕ B ) Θ B

which is simply A eroded and then dilated by B.

This smoothens out contours, fuses narrow breaks,eliminates small holes, and fills contour gaps.

Opening and Closing

38

Hit-or-miss Transform

Hit-or-miss Transform is a powerful tool todetect shapes. It is defined as the set ofmatches of B in A:A ⊗ B = ( A Θ B1 ) ∩ ( AC Θ B2 )

Where B1 is the shape to detect, and B2 isthe set of element associated with thecorresponding background.

39

A Matlab Example

A=imread('text.tif'); %load image

X=A(35:47,45:55); %define object to find

B2(15,13)=1; %compute B2

B2(2:14,2:12)=not(X);

AC=not(A); %complement of image

z1=erode(A,X); %find object

z2=erode(AC,B2);

z=and(z1,z2);

imshow(z) %display

40

The object to be detected

41

Original image

42

The Complement of the origin

43

Detected locations

44

Some Basic MorphologicalAlgorithms

• Boundary Extraction

β(A) = A - ( A Θ B )

the extracted boundary of the objectdepends on the structuring element B.

45

A Matlab Example:

A=imread('air.bmp'); %load image

A=A(:,:,1);

beta=and(A,not(erode(A,ones(3,3))));

imshow(A) %display original

figure

imshow(beta) %%display original

46

Original image

47

Image after border extraction

48

Region Filling

Fills the region inside the boundary.

Xk = ( Xk-1 ⊕ B ) ∩ AC for k = 1,2,3,…

B is the structuring element.

49

Convex Hull

Finds the convex hull for the object:

X ki = ( X ⊗ Bi ) ∪ A

Four structuring elements (Bi ‘s) are needed.

50

Thinning

• Thinning is a transform that decreases thethickness of an object.

• It uses several passes using differentstructuring elements.

51

Thickening

• Thickening is the dual of thinning.

• It adds thickness to the object.

• It uses several passes with a differentstructuring element each time.

52

Pruning

This process is helpful to eliminate parasiticelements usually left by other transforms. Itsmoothens out boundaries.

53

Bibliography

• [1] Anil K. Jain, “Fundamentals Of Digital ImageProcessing”, Prentice Hall, 1986.

• [2] Gonzales C. Rafael, Richard E. Woods,“Digital Image Processing”, Addison-Wesley,1993.