5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis...

39
5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentatio Orientation Analysis

Transcript of 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis...

Page 1: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology

Naples 2001

12th - 14th September

Image Analysis

Lecture 6Morphological Segmentation

Orientation Analysis

Page 2: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

•Operations which rely only on pixel in question

•Threshold•mathematics using a single pixel and constant

•e.g. add 10 to each pixel - or subtract or multiply etc.

•mathematics using a single pixel with corresponding pixels in one or more images

•e.g. multiply pixel (x) in image A by value in pixel (x) in image B.

Each pixel is processed in turn

Summary of some key operations of Image Analysis/Processing

Page 3: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

•Operations which rely only on pixel in question and neighbouring ones (e.g. kernel or convolution filter)

each pixel is processed in turn

Summary of some key operations of Image Analysis/Processing

0 0 1 0 0

0 1 1 1 0

1 1 1 1 1

0 1 1 1 0

0 0 1 0 0

0 0 0 0 1

0 0 0 1 0

0 0 1 0 0

0 0 0 1 0

0 0 0 0 1

Many different types of kernel

• averaging

• hit and miss

Page 4: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

•Intensity Gradient Analysis

•Orientation Analysis

•Domain Segmentation

•Improved Visualisation of Images.

Some alternative methods for segmenting images and related topics

Page 5: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

For many images, unambiguous segmentation is not possible as the resulting image is too complex even for manual editting to ensure that particles and voids are adequately separated.

Advantages:

•avoids thresholding/segmentation problems•can remove subjectivity entirely•can reduce complex images to a relatively few parameters which can be related to external factors such as stress level, water flow etc.

Segmentation of images without the need for segmentation

An alternative approach examines changes in intensity and not absolute values.

Page 6: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 1 and magnitude image from Intensity Gradient Analysis. Output image is a form of edge detector.

Segmentation of images without the need for segmentation.

Intensity Gradient Methods were devised primarily as edge-detectors.

Page 7: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

20 1

Simplest form of edge detector considers point 0 and one adjacent pixel.

For x-direction - pixel 1 is used

i.e. change in intensity is given by d

II

x

I o

1

d

II

y

I o

2

An estimate of the orientation is thus available at each pixel.

where d is distance between pixels

For y-direction - pixel 2 is used.

Page 8: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

20 1

Greatest gradient of intensity change will be at right angles to edges and this can be used to define an improved edge-dector or to define the orientation of features at every pixel within an image.

Intensity Gradient Analysis

Background

xIyI

1tan

Two critical parameters are available - the orientation and M the magnitude of the intensity change

22

y

I

x

IM

Page 9: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

A better edge detector considers points 0 and 1 - 4.

For x-direction

change in intensity is given by d

II

x

I

231

d

II

y

I

242

23 0 1

4

This filters some noise and is alternatively known as the 4:2 formulation as four points are used in a 2nd order solution.

where d is distance between pixels

For y-direction

Page 10: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

23 0 1

4

For the 4:2 formula, the X - direction kernel will be defined by:-

while the Y - direction kernel is:-

0 0 0

-0.5 0 0.5

0 0 0

0 0.5 0

0 0 0

0 -0.5 0

A convenient way to process an image is to define a kernel by which the pixels surrounding the pixels of interest and multiplied by appropriate factors.

Page 11: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

Intensity Gradient Analysis

Best results are obtained using 20 nearest surrounding pixels.

Gives a fourth order solution for orientation - only 14 points are required so least squares analysis possible thereby providing some filtering

Page 12: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

Intensity Gradient Analysis

Kernels for 20,14 Analysis Mehtod of Smart and Tovey and also Sobel Operator.

0 0 0 0 0

0 -1 0 -1 0

0 -2 0 -2 0

0 -1 0 -1 0

0 0 0 0 0

0 13 0 -13 0

77 -207 0 207 -77

-70 -280 0 280 70

77 -207 0 207 -77

0 13 0 -13 0

The Sobel Operator uses a 3 x 3 kernel.

Smart and Tovey (1988) kernel for 20,14 method. This kernel is most accurate in specifying orientation. Values are multiplied by 1000.

.rotationbyobtainedareyIshownarex

I

Page 13: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

0

270 90

180

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

i.e. 0 degrees is vertically upwards

90 degrees is horizontal

angles go clockwise.

Mathematical convention

0 degrees horizontal

90 degrees vertically upwards

angles go anticlockwise.

Orientation convention follows geological convention

Page 14: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 1 and angles-coded image

Each pixel has orientation defined by colour scale.

Howver, output image can be difficult to interpret

Page 15: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Over 250 000 estimates of orientation.

Data used to define a rosette diagram - often approximately shaped as an ellipse.

Page 16: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

4.....)(

)(

3.....1

2.....

1.....

definitionMinMax

MinMaxI

definitionMax

MinI

definitionMax

MinI

definitionMin

MaxI

a

a

a

a

Shape of rosette diagram usually approximates to an ellipse.

Use Least Squares to find best fitting ellipse and length of major and minor axis.

Index of Anistropy Ia may be defined in 4 diffferent ways.

Max and min refer to lengths of major and minor axes of ellipse.

Page 17: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Sokolov used a different definition:

Areas of rosette are divided into 90o segments centred on major and minor axes.

)/()(1 '22

'11 SSSSAg

This is equivalent to definition 3 Max

MinIa 1

This is the preferred definition these days as it is a bounded scale from 0 (random) to 1 as full orientated.

Sokolov uses percentage rather than a ratio 0 - 1.

Page 18: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Index of Anistropy can usually be computed, but if rosette diagram departs significantly from ellipse, then problems may arise.

Alternative:

Mean Resultant Vector (also known as Consitency Ratio)

• works in all cases.

Define vector of unit magnitude at each pixel in angles-coded image having components in X- and Y- directions:

i.e. at ith pixel - the angle is i and components are

cos i and sin i in the two directions respectively.

Page 19: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

NS

NC

i

N

ii

N

i

11

sin:

cos

22 SCR

The respective components at all N points in the image are summed to generate two parameters C and S:

Additionally the Mean Resultant Vector (R) may be defined as:

Also the mean orientation is defined as:

)()( 11 sincos RS

RC

Page 20: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

The Mean Resultant Vector can always be computed even if the rosette diagram is unimodal.

The range is also 0 - 1 as for the Index of Anisotropy.

However, the value will depend on reference direction set.

[Curray, (1956), Mardia (1972), and Tovey (1972) independantly show a method by which this problem can be overcome].

The range of Mean Resultant Vector over which most Real Soils exist, is significantly less than the Index of Anisotropy and the latter is recommended for most applications.

Page 21: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 2:

High degree of general orientation

Page 22: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 3:

High degree of localised orientation but random otherwise

Page 23: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 4:

Near orientation Random orientation

Page 24: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 5:

High degree of localised orientation but random otherwise

Page 25: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 6:

High degree of general orientation

Page 26: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Advanced Orientation - Domain Segmentation

Index of Anisotropy is relatively easy to determine

but Angles-Coded image can be difficult to interpret

Domain Segmentation attempts to define regions of generally consistent orientation.

Page 27: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Advanced Orientation - Domain Segmentation

Each pixel orientation value is replaced by its general orientation direction.

With 4 coded classes, the replacement values are as in table.

From To Code0 22.5 122.5 67.5 267.5 113 3112.5 158 4157.5 180 1

Page 28: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

A large radius Modal filter is passed over image.

In example, there are more pixels coded 4 in mask area, and so central pixel is replaced by code 4. If no class is dominant, class 5 (random) is coded).

In examples to be used in this Course, just 4 classes are used for simpliicty. Usually 8, 12 or 16 classes are used.

At each point, the proportion of each class is determined, and the dominant class then replaces the pixel value in question.

Page 29: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Domain Segmentation of Image 1 using a 19 pixel radius Modal Filter - colour representation

Page 30: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

To help visualisation, boundaries of domains may be overlain on original image.

Page 31: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Alternatively, just domains of a given general orientation may be displayed - in this case the vertical domains.

Page 32: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Better approach is to use colour overlay

Image 1

Page 33: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 2

Page 34: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 3

Page 35: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 4

Page 36: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 5

Page 37: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Image 6

Page 38: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

Difficulties with Intensity Gradient Analysis and Solutions:

low contrast, and brightness varies little between pixels.

Solution:

redefine all pixels where pixel value in MAGNITUDE image is less than a given value as “undecided” - typically less than 1% in images of clays. Tovey et al. Recommend that magnitude values < 2.0 be treated in this way.

Will not all orientation vales be weighted equally irrespective of contrast in Index of Anisotropy.

YES - and this ensures that there is no bias just for brighter features.

However, by using selected ranges of magnitude, various brightness features may be treated differently.

Page 39: 5th Intensive Course on Soil Micromorphology Naples 2001 12th - 14th September Image Analysis Lecture 6 Morphological Segmentation Orientation Analysis.

5th Intensive Course on Soil Micromorphology - Naples 2001Image Analysis - Lecture 6: Morphological Segmentation

What happens if there are large particles with little or no contrast?

Will this not distort Index of Anisotropy?.

To some extent this may be true, but intensity values in these regions are usually below threshold value and are disregarded anyway.

More advanced multiple segmentation methods are available - see later lecture.