36
Ali abdul-zahraa

Features image processing and Extaction

Embed Size (px)

Citation preview

Page 1: Features image processing and Extaction

Ali abdul-zahraa

Page 2: Features image processing and Extaction

We will discuss shape-based representations

(external), features based on texture and

statistical moments (internal) .

look at principal component analysis (PCA), a

statistical method which has been widely

applied to image processing problems.

We are assume that an image has undergone

segmentation.

Page 3: Features image processing and Extaction

The common goal of feature extraction and

representation techniques is to convert the

segmented objects into representations that

better describe their main features and

attributes.

The type and complexity of the resulting

representation depend on many factors, such

as the type of image (e.g., binary, grayscale, or

color), the level of granularity (entire image or

individual regions) desired.

Page 4: Features image processing and Extaction

Feature extraction is the process by which

certain features of interest within an image are

detected and represented for further

processing.

It is a critical step in most computer vision and

image processing solutions because it marks

the transition from pictorial to nonpictorial

(alphanumerical, usually quantitative) data

representation.

Page 5: Features image processing and Extaction

The aim is to process the image in such a waythat the image, or properties of it, can beadequately represented and extracted in acompact form amenable to subsequentrecognition and classification.

Representations are typically of two basickinds:

internal (which relates to the pixels comprisinga region)

or external (which relates to the boundary of aregion).

Page 6: Features image processing and Extaction

A feature vector is a n × 1 array that encodes

the n features (or measurements) of an image

or object.

The array contents may be:

symbolic (e.g., a string containing the name of

the predominant color in the image)

numerical (e.g., an integer expressing the area

of an object, in pixels) I’ll interested in.

or both

Page 7: Features image processing and Extaction

A very basic representation of a shape simply

requires the identification of a number N of

points along the boundary of the features. In

two dimensions, this is simply.

Page 8: Features image processing and Extaction

A common requirement for feature extraction

and representation techniques is that the

features used to represent an image be

invariant to rotation, scaling, and translation,

collectively known as RST.

RST invariance ensures that a machine vision

system will still be able to recognize objects

even when they appear at different size,

position within the image, and angle (relative to

a horizontal reference).

Page 9: Features image processing and Extaction

A binary object, in this case, is a connected

region within a binary image f (x, y), which will

be denoted as Oi, i > 0. Mathematically, we can

define a function Oi(x, y) as follows:

Oi(x, y) = 1 if f (x, y) ∈ Oi

0 otherwise

The matlab function bwlabel, pixels labeled 0

correspond to the background; pixels labeled 1

and higher correspond to the connected

components in the image.

Page 10: Features image processing and Extaction

we mean that the selected coordinates constituting

the boundary/shape must be chosen in such a way

as to ensure close agreement across a group of

observers.

If this were not satisfied, then different observers

would define completely different shape vectors for

what is actually the same shape.

achieved by defining criteria for identifying

appropriate and well-defined key points along the

boundaries , Such key points are called

landmarks

Page 11: Features image processing and Extaction

Landmarks essentially divide into three

categories:

Mathematical landmarks

Anatomical or true landmarks

Pseudo-landmarks

Page 12: Features image processing and Extaction

These correspond to points located on an

object according to some mathematical or

geometric property (e.g. according to local

gradient, curvature or some extremum value).

Page 13: Features image processing and Extaction
Page 14: Features image processing and Extaction

These are points assigned by an expert which

are identifiable in (and correspond between)

different members of a class of objects.

Examples of anatomical landmarks are the

corners of the mouth and eyes in human faces.

Page 15: Features image processing and Extaction

These are points which are neither

mathematically nor anatomically completely

well defined, though they may certainly be

intuitively meaningful and/or require some

skilled judgment on the part of an operator.

An example of a pseudo landmark might be

the ‘ centre of the cheek bones’ in a human

face, because the visual information is not

definite enough to allow unerring placement.

Page 16: Features image processing and Extaction

• Anatomical landmarks

(indicated in red) are located

at points which can be easily

identified visually.

• Mathematical landmarks

(black crosses) are identified

at points of zero gradient and

maximum corner content.

• The pseudo-landmarks are

indicated by green circles

Page 17: Features image processing and Extaction

In certain applications, we do not require a

shape analysis/recognition technique to

provide a precise, regenerative representation

of the shape. The aim is simply to characterize

a shape as succinctly as possible in order that

it can be differentiated from other shapes and

classified accordingly.

Page 18: Features image processing and Extaction

a small number of descriptors or even a single

parameter can be sufficient to achieve this

task.

Note that many of these measures can be

derived from knowledge of the perimeter

length.

Page 19: Features image processing and Extaction

The following Table gives a number ofcommon, single-parameter measures ofapproximate shape

which can be employed as shape features inbasic tasks of discrimination and classification.

Note that many of these measures can bederived from knowledge of the perimeterlength,

the extreme x and y values and the total areaenclosed by the boundary – quantities whichcan be calculated easily in practice.

Page 20: Features image processing and Extaction
Page 21: Features image processing and Extaction

1. Area

The area of the ith object Oi, measured in

pixels, is given by:

2. Centroid

The coordinates of the centroid (also known as

center of area) of object Oi, denoted (x¯i, y¯i),

are given by: or

Page 22: Features image processing and Extaction

3. Projections

The horizontal and vertical projections of a

binary object—hi(x) and vi(y), respectively—are

obtained by equations:

and

Page 23: Features image processing and Extaction

Projections are very useful and compact shape

descriptors. For example, the height and width

of an object without holes can be computed as

the maximum value of the object’s vertical and

horizontal projections, respectively, as

illustrated in Figure:

Page 24: Features image processing and Extaction

4. Thinness Ratio

The thinness ratio Ti of a binary object Oi is a

figure of merit that relates the object’s area and

its perimeter by equation

Ti = (4πAi)/(Pi^2)

where Ai is the area and Pi is the perimeter

Page 25: Features image processing and Extaction

The thinness ratio is often used as a measure

of roundness.

Since the maximum value for Ti is 1 (which

corresponds to a perfect circle), for a generic

object the higher its thinness ratio, the more

round it is.

This figure of merit can also be used as a

measure of regularity and its inverse, 1/Ti is

sometimes called irregularity or compactness

ratio.

Page 26: Features image processing and Extaction

A=imread('coins_and_keys.png'); subplot(1,2,1), imshow(A);

%Read in image and display

bw=~im2bw(rgb2gray(A),0.35); bw=imfill(bw,'holes'); %Threshold and fill in holes

bw=imopen(bw,ones(5)); subplot(1,2,2), imshow(bw,[0 1]); %Morphological opening

[L,num]=bwlabel(bw); %Create labelled image

s=regionprops(L,'area','perimeter'); %Calculate region properties

for i=1:num %object’s area and perimeter

x(i)=s(i).Area;

y(i)=s(i).Perimeter;

form(i)=4.*pi.*x(i)./(y(i).^2); %Calculate form factor

end

figure; plot(x./max(x),form,'ro'); %Plot area against form factor

% regionprops Measure properties of image regions

Page 27: Features image processing and Extaction
Page 28: Features image processing and Extaction

The key and drill bit are easily distinguished

from the coins by their form-factor values.

However, the imperfect result from thresholding

means that the form factor is unable to

distinguish between the heptagonal coins and

circular coins. These are, however, easily

separated by area.

Page 29: Features image processing and Extaction

1. Chain Code, Freeman Code, and Shape

Number:

A chain code : is a boundary representation

technique by which a contour is represented as

a sequence of straight line segments of

specified length (usually 1) and direction.

Page 30: Features image processing and Extaction
Page 31: Features image processing and Extaction

Once the chain code for a boundary has been

computed, it is possible to convert the resulting array

into a rotation-invariant equivalent, known as the first

difference

Page 32: Features image processing and Extaction
Page 33: Features image processing and Extaction
Page 34: Features image processing and Extaction

Fourier Descriptor Fourier descriptor: view a coordinate (x,y) as a complex number

(x = real part and y = imaginary part) then apply the Fourier

transform to a sequence of boundary points.

)()()( kjykxks

1

0

/2)(1

)(K

k

KukeksK

ua Fourier descriptor :

1

0

/2)(1

)(K

k

KukeuaK

ks

Let s(k) be a coordinate

of a boundary point k :

Reconstruction formula

Boundary

points

Page 35: Features image processing and Extaction

Example: Fourier Descriptor

Examples of reconstruction from Fourier descriptors

1

0

/2)(1

)(ˆP

k

KukeuaK

ks

P is the number of

Fourier coefficients

used to reconstruct

the boundary

Page 36: Features image processing and Extaction

Fourier Descriptor Properties

Some properties of Fourier descriptors