• Nie Znaleziono Wyników

Determining particle size distributions from video images by use of image processing

N/A
N/A
Protected

Academic year: 2021

Share "Determining particle size distributions from video images by use of image processing"

Copied!
99
0
0

Pełen tekst

(1)

1

I

I

1-1

1

I

1-I

I

1

I

I

I

I-

TU

Delft University of Technology

Delft

I

Department of Civil Engineering

Hydraulic and GeotechnicalEngineeringDivision HydromechanicsSection

(2)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

Determiningparticle size

distributions trom video images

by use ot image processing

J. de Graatt and R.E. Slot

report no. 4-95, February 1993

(3)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

CONTENTS 1. INTRODUCTION

1

2. PROBLEMS

2

3. METHODS

3

4. TESTS

9

5. RESULTS

10

7. LITERATURE

14

APPENDICES:

A: TESTING THE PROGRAM, FIGURES

15

B: PROGRAM DESCRIPTIONS .

45

Descriptions Flow diagrams

46

60

C: TESTING MODULES OF THE PROGRAM, FIGURES

66

1. Comparison isodata threshold program with thrnsgm. 67

2. remedcon.tip 77

3. paint.tip . 81

(4)

I

I

I

I

1. INTRODUCTION

I

Recently a lot of research is being done on cohesive sediment. It plays a major role in the shoaling of harbours and waterways, and in some serious environmental problems. To predict cohesive sediment transport, information is needed about the distributions of size and settling velocities. Many methods exist to determine sizes suspended particles, but most are not applicable to cohesive sediment flocs, because of their fragility. If not at sampling, the flocs break at the subsequent analysis by for example the Coulter Counter or the pipet method. In case of analysis by the Owen tube another problem occurs next to the floc break up at sampling: the long duration of the analysis leads to additional flocculation and causes the measured distribution to be even more unrealistic.

To solve these problems, exposures are made by underwater cameras, which give instantaneous information about the undisturbed samples. From one exposure the floc sizes can be determined, and from two successive exposure with known time between them, the settling velocities can be determined.

50 far, the analysis of exposures of flocs was mainly done by hand. Image processing by computer provides a way to do this automatically. It saves time, and consequently more flocs can be analyzed, leading to more representative distributions.

The subject of th is report is the development and testing of an image processing program to determine the size distribution. The program is applied to digitized exposures, as can be made by a framegrabber. The framegrabber converts a recording on tape or from a ccd camera into a matrix of digits, the value of each digit representing the brightness of the corresponding pixel. From this grey value image, the image processing program has to distinguish the relevant objects, in other words, make a binary image, consisting of object pixels and non object pixels. This is quite complicated, due to inevitable interferences on the exposures like background features and shadow effects. After producing the binary image, the program has to determine partiele sizes and calculate and plot the size distributions.

This report describes the problems that are met when segmenting objects from a background (chapter 2), the mathematica I methods to overcome them (chapter 3), some tests with the software that has been developed (chapter 4), and the results of these tests (chapter 5). The tests have been done on exposures with reference objects (ideal objects and background). The results are also visualized in the appendices. Also details on the software, that was developed using a software package for image processing, TCU, are given in the appendices.

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

1

(5)

2.

PROBLEMS

I

I

I

I

Several features of the exposures of cohesive sediment flocs disturb the images

of the flocs and cause difficulties when determining the exact shapes of the relevant flocs:

(1) - the exposures do not only consist of objects but also of varying backgrounds;

(2) - the edges of the objects are not equally sharp at every place;

(3) - the brightness of the objects varies;

(4) - shadow effects occur, because of illumination from aside;

(5) - some objects have holes;

(6) - objects at the edge of the image are not completely visible;

(7) - the objects overlap each other.

Problems (1) to (4) concern segmentation of the objects from the background, and are treated in chapter 3.1. Problems (5) to (7) are successively treated in chapter

3.2

to

3.4.

I

I

I

I

I

I

I

I

I

I

I

I

I

I

2

I

I

--- -

(6)

---I

I

I

I

3.

METHOOS

I

I

I

3.1 Segmentation

The problems (1) up to and including (4) are all about distinguishing the objects from the background. To solve these problems, the program determines the second derivative of the brightness of the images. In the following, the effectiveness of several methods is discussed. Starting with the least complicated method of segmentation direct from the image, and moving to more complicated ones the use of the second derivative is supported.

Segmentation direct trom the image.

Because objects have different brightness and because of the presence of varying background, accurate segmentation direct from the image is difficult:

I

1

object 2 threshold object 1

I

I

I

UI UI

.,

c s: .g' .D

I

/

fluctuations of

the background

location - __

tig. 3.1. A plot trom the image consisting a bright and a weak object and background.

I

I

By lowering a detection threshold in c~ses such as shown in fig. 3.1 object number 1 is first detected, second some background is detected on the left; only by further lowering the threshold object number 2 is detected.

Segmentation trom the tirst derivative ot the brightness.

Boundaries between objects and background give extreme values in the first derivative.

I

I

1

object' object 2

..

.~ ë .~ ~ -e location ~

I

I

fluctuotions of the background

I

I

figure 3.2. A plot of the first order derivative of brightnessof the imagein tig. 3.1 (absolute values).

3

(7)

Only peaks of the two objects are detected. There is no problem with different brightness and with the background. After segmentation, the binary image shows boundaries between objects and background as thick lines, which are rings in case the objects are dots. The boundary of the object is defined on the place where there is a maximum gradient of the brightness (first order derivative has a peak or

second order derivative is equal to zero). In case of a symmetric peak, the real

boundaries are found in the middle of the thick lines, the skeletons (fig. 3.3).

I

I

I

I

boundory object background

I

I

I

threshotd

I

Iocctice___.

i

I

I

I

ctcceofthe skelet

figure 3.3. In ease of a symmetrie peak the top, whieh indieates the boundary between object and background, coincides with the skeleton.

Hence the boundaries between objects and background are rather easily determined by the proces of skeletonisation. After filling up the closed spaces formed by the boundary lines, the bitplane shows objects and background. However, th is method can not be used if the peaks are not symmetric.

I

I

Segmentation trom the second derivative ot the brightness

If the first order derivative is asymmetric, for example caused by a shadow effect, the next problem occurs, fig. 3.4:

I

I

I

I

I

4

I

I

(8)

I

I

I

I

1

I

I

I

I

I

I

I

boundary lhreshold object background ERROR locolion --_. olace of the skelet

figure 3.4. In an asymmetrie peak, the differenee between top and skeleton eauses an error if the boundary has been determined by skeletonation.

The error between the place of the skeleton and the place of the true boundary makes it impossible to correctly determine the boundaries by this method. On the top, the slope of the curve is equal to zero. This means that on that location the second derivative is equal to zero. Therefore the locations of the boundaries are defined by the locations where the second derivative is equal to zero.

I

I

I

I

I

I

I

I

I

5

(9)

_

~

.,

o ., ., "0 ., Cl) ~ C "00-=> .&:. - "0 0-.- C' -e O.D g'u E <>_.,0 <> ~ o > .~ 0 "0 boundory

object

I

I

I

I

locotion --_.. nd 2 derivotive = 0

I

I

I

I

I

I

I

figure 3.5. The locationof 2nd derivative=0 on the boundary between background and object.

The objects are distinguished by, firstly, searching for the piaces or lines where the second derivative

=

0 and, secondly, by filling up the closed spaces surrounded by these lines. When using th is method there is still one problem. The fluctuations of the background also give second derivative = O.

r

Q) > ~ 0 >

0

Q) -0 -0 C 0 U Q) lil object 1 object 2 .A j..A A

(

V v v

1

/

\

1/

/

fluctuations of the background location --+

I

I

I

I

I

I

I

figure 3.6 Second derivative from two objects and from fluctuations of the background.

This can be resolved by the use of the first derivative. Segmentation with a threshold gives reference areas (fig. 3.7).

6

I

(10)

I

I

I

I

r

ob,iKt1 object 2 reler.nee areas

I

I

I

loccr1ion_

figure 3.7 Reference areas.

Secondderivatives equal to zero are selected, as those caused by the boundaries

between objects and backgroundfall within referenceareas,whereas those caused

by the fluctuations of the background do not, see fig.

3.8.

object

backg rou nd

I

arginal

...~.",

.

.

:

;

I

I

I

nd .

ti

0

2 derivo

Ive~

boundary object boundary background

r-.L

I I L I

I

I

reference

a rea s :

fill

up

holes

in

reference

areas

I

I

r---I I L __ _I

selected

areas

of

2

nd

derivctive

. .

e

O

I

I

figure 3.8 The selection of the object from the background. In this iIIustration the object is imagined as a triangle and the background as a weak square box.

Segmentationof the referenceareasis not possiblewith a constant threshold value

for all images, because in some exposuresthe backgroundfluctuates more than in

others. As an example, an exposure with weak and another with

strong

background fluctuations is given in fig 3.9.

I

I

7

(11)

weok background fluctuotions strong background fluctuotions obJect

i

-3

thrMhoid 2 -;... thrllhold ë '" location_

i

ob~

1

.:»

\._,...} ~ location_

Figure 3.9 The dependence of the threshold on the background fluctuations.

The threshold depends on background fluctuations: the stronger the fluctuat

i

ons

the higher the threshold neededfor segmentation

.

The threshold is determined by use of the nu - method:

threshold

=

mean

+

nu

mean

:

average value of background f

l

uctuations

;

u

:

Root Mean Square of background fluctuat

i

ons;

n

:

Real value (no-O).

The Ro

o

t

Me

an

S

qu

a

r

e

i

s de

te

r

mined

w

ith:

with: x

2:

the square of mean over all values, and x

2:

mean over all square values

Details about th is method and the way

i

t has been implemented in the program are

g

i

ven in appendix B

.

1.1.

3

.

2 Objects with holes

Cohesive sed

i

ment flocs are loose, fragile structures of clay and organ

i

c material

,

containing a lot of water. In some cases even holes are visible on the exposures.

As the program determ

i

nes equ

i

valent object diameters basedon object areas, the

appropr

i

ate equ

i

valent diameter of an object with a hole can on

l

y be obta

i

ned by

i

ncluding the surface of the ho

l

e

.

Therefore the program fills up the areas enclosed

i

n ob

j

ects

.

3.3 Over

l

apping objects

Ob

j

ects a

t th

e edge o

f t

he

i

magea

nd

over

l

app

in

g ob

j

ec

t

s a

r

e o

nl

y party v

i

s

i

ble

,

a

nd

it i

s

imp

oss

i

b

l

e

t

o es

tim

a

t

e

th

e

ir

e

x

ac

t si

ze

.

Th

e

r

e

f

o

r

e

, th

e

pr

og

r

a

m

de

t

ec

t

s

all

objects conn

e

ct

e

d to the edge of the image and removes them befor

e

the size

di

s

tributi

o

n i

s de

t

e

rmined. The ov

e

rl

a

ppin

g ob

j

e

ct

s

ar

e

n

o

t tr

ea

t

e

d in

a s

p

e

ci

a

l wa

y

,

b

e

c

a

u

se

th

e e

nvi

sage

d us

e

of th

e

pro

g

r

a

m d

oe

s not includ

e

m

e

a

s

uring hi

g

h

se

d

iment c

o

n

ce

ntr

a

tion

s

.

C

onsequ

e

ntly

,

ov

e

rl

a

pping of object

s

wil! r

a

r

e

ly occur and

n

ot s

i

gn

i

f

i

cantly infl

u

ence the s

i

ze d

i

st

ri

but

i

on

.

8

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(12)

I

I

I

I

I

I

I

4. TESTS

I

I

To test the developed program, it is used to determine the size distribution of simulated exposures, made by manipulating reference images. The references consist of sharp-edged black objects on a white background and are manipulated in three ways. The edges are made unsharp by filtering the reference (see [3], "uniform filter"). The background is modified by multiplying the reference (factor

<

1). (The multiplication does not change the objects, as they are black, and in the digitized image black is zero and white has the maximum value.) The brightness of the objects is reduced by multiplying the reference and then adding a certain value to the whole image in order to make the background white again. Then the objects are not black anymore, but have turned a whiter shade corresponding to the added value.

The tests are performed with: (1) - dots;

(2) - silt particles with few branches; (3) - silt particles with strong branches; (4) - different backgrounds;

(5) - different brightness.

The objective of the first three tests is to examine the relationship between the particle shape and the deviation of the size distribution from the reference. The deviation is caused by unsharpness and background. Therefore the tests are performed in two steps: firstly an unsharp image is generated and secondly background is introduced. For every one of the three object shapes the size distribution of the reference, of the image with unsharp edges and of the image with unsharp edges and background are compared. The objective of (4) is to examine the influence of different backgrounds. The size distribution of the objects of (2) is determined again, but with a different background. It is expected that the influence of the background becomes stronger when the particles are less bright. The objective of (5) is to investigate how strong this influence is, and which limit still yields an acceptable result.

I

I

I

I

I

I

I

I

I

I

I

9

(13)

5. RESULTS

The tests and the results described in this chapter are visualized in appendix A. The size of the class in the histograms is 0.5 mmo

5.1 Dots

Comparing the size distributions of the unsharp image, the unsharp image with background and the reference yields that they are exactly the same, including the mean and the sigma. Comparing the binary images and the reference visually (fig A 1.2, 1.4 and 1.5) yields that fig A 1.2 differs from the reference in about 1 out of every 4 dots 1 or 2 pixels. The same is true for fig A 1.4 compared with the reference. There is no difference between fig A 1.2 and fig A 1.4. Hence it can be concluded that the unsharpness causes more deviation than the background. Still, the deviation is obviously too small to cause deviations in the size distributions.

5.2 Silt particles with few branches.

When comparing the binary images that are made of the unsharp image (fig. A 2.2) visually, it is seen that small objects are made little larger, as compared to the reference. An example for a star-shaped object:

o

o

reference tromofter unshorpsegmentationobject

fig 6.2.1 influence of unsharpness on a small partiele.

It is not clear how this should be explained. It could be due to the way the

reference objects are made unsharp,or to the method by which the edges of the

objects are determined. For small objects it yields surfaces or equivalent diameters

that are larger than reality. It is also found in the size distribution (fig A 2.6)

.

The

difference is largest between 0

.

0 and 1.0 mm

1'.

In the class: 0.0-0.5 mm no

particle is found and in 0.5-1.0 mm 34%, whereas in the size distribution of

referencethis is 9.5% in 0.0-0.5 mm and 28% in 0.5-1.0 mmoThe effects become

clear when looking at the mean value, increasing from 2.28 mm to 2

.

37 mm

(3.9%) and at the sigma, decreasingfrom 1.10 mm to 1

.

01 mm (8.2%).

Modifying the background of the unsharp

i

mage causes smaller deviations than

mak

i

ng

t

he u

n

s

h

arp

i

mage o

u

t o

f

the re

f

erence

.

Compar

i

ng t

h

e b

i

nary

i

mages f

i

g

.

A 2

.

4 a

n

d 2

.

2 y

i

e

ld

s

th

a

t

abo

ut 1

o

ut

o

f

eve

ry

5 part

i

c

l

es dev

i

ates

.

As

f

o

r th

e

l

The

v

al

u

es o

f m

ean and

s

igma are exp

r

essed

in m

m by a co

nv

ers

i

o

n f

acto

r

o

f 1

p

ix

e

l

=

O.05

8

82mm

2,

based on a certain camera

-

object d

i

stance

,

see also appendix.

10

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(14)

- ---

-I

I

I

I

distributions, the only significant difference lies in the area between

0.5

and

1.5

mmo The mean is decreased from

2.37

to

2.36

and the sigma increased from

1.01

to

1.02,

both less than

1%.

The resulting total deviation from the reference amounts to

3.5%

for the mean and

7.3%

for the sigma, mainly caused by the unsharpness.

5.3 Silt particles with strong branches.

I

I

I

I

I

I

I

Like

6.2

unsharpness here causes the most influence on the shape of the particles. Visual comparison of the binary images yields th at the surfaces of the small particles are larger, the branches little thicker and the inlets little smaller. Due to the binary processing, some objects are split up into two or more objects. The differences in the size distribution appears on two places. Firstly, between

0.0-0.5

mm the percentage is decreased from

37%

to

28% ,

between

0.5-1.0

mm and

1.0-1.5

mm respectively increased from

7

to

13%

and from

3.5

to

6%.

Secondly,

objects above 5 mm are not found any more. Consequently, the mean value is increased from

2.24

mm to

2.27

mm

(1

.

3%)

and the sigma is decreased from

1.24

mm to

1.21

mm

(2.4%).

The background has less influence on the binary image and on the distribution. Compared to the unsharp case, the shapes hardly change, and some particles do not change, even with strong branches. However, some small objects are not detected. The size distribution gives a little increase in

3.0

-

3.5

mmo For the mean this gives an increase from

2.27

to

2.32

mm

(2.2%).

The sigma is hardly changed:

1.21

to

1.20

mm

(0.8%) .

The resulting total deviation from the reference amounts to

3.6%

for the mean and to

3.3%

for the sigma, mainly caused by the unsharpness.

5.4 Different background

I

I

Comparing the binary images fig. A

4.2

and

2

.

2

visually yields that for over

50%

of the particles, no change has taken place at all, whereas the remaining particles usually differ in only 1 or 2 pixels.

The important differences in the size distribution take place on small particles between

0.5

and

1.0

mm (fig. A

4.3).

The mean remains unchanged and the sigma differs about 1

%.

I

I

I

I

I

I

I

5.5 Different brightness.

Step one: black to

1/2

black (maximum brightness to

1/2

maximum brightness): The particles in the binary images (fig. A

2

.

4

and

5.3)

visually differ generally about

2

pixels, mostly they are smaller in A

5.3.

For

30%

of the particles, there is no difference. This leads to a little change to the left in the size distribution and a drop of the mean value from

2.36

mm to

2

.

32

mm, about

2%

(fig A

5.7).

The sigma increases from

1.02

mm to

1.07

mmo

Compared with the reference these values deviate respectively

1.8

and

2.7%.

(15)

Step two: 1/2 black to 1/4 black (1/2 maximum brightness to 1/4 max. brightness):

At visual comparison, the shape of the particles differs stronger (compare fig. A

5.6 with A 5.3) and 22 particles are not detected. Also the distribution differs

stronger. The sigma drops from 1.07 mm to 0.98 mm, about 9%. The mean value increases from 2.32 mm to 2.37 mmo

Compared with the reference the mean and sigma deviate respectively 4 and 11

%.

This means that the limit of brightness is reached for acceptable analysis.

5.6 Summary

The results are summarized in the following tables:

Table 5.1 The deviation of the mean and the sigma as a result of

branches.

influence

influence

total

unsharpness

background

influence

mean

sigma

mean

sigma

mean

sigma

dots

0.00

0.00

0.00

0.00

0.00

0.00

silt particles

3.94

-8.18

-0.43

0.91

3.51

-7.27

with few

branches

silt particles

1.34

-2.42

2.23

-0.81

3.51

-3.23

with strong

branches

Table 5.2 The mean and the sigma as a result of the influence of different

backgrounds.

mean

sigma

(mm)

(mm)

background nb

.

1

2.36

1.02

background nb

.

2

2.36

1.03

The influence of d

i

fferent backgroundson the mean and the sigma is very srnal

l

.

12

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(16)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

Table 5.3 The deviation of the mean and the sigma as a result of the influence of different brightness of objects.

total influence N mean sigma (%) (%) black 93 3.51 -7.27 1/2 black 93 1.75 -2.73 1/4 black 74 3.95 -10.91

Decreasing in brightness gives na generally positive or negative trends in the deviations. The weakest partieles give the sigma value is more than 10%. For partieles of 1/4 of maximum brightness or weaker the number of partieles that are not detected is increasing.

(17)

14

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

7.

LlTERATURE

[1] - A Kelly and I Pohl,

An introduction to programming in C

The Benjamin/Cummings Publishing Company,lnc (1984) TCl-lmage User's Manual, Part Two

[2] - TU Delft, UvA, TPD

Image Processing for Industrial Applications, Introductory Course: 28-29 Oktober 1991

[3] - manuals of Multihouse TSI: TCl-lmage User's Manual, Part One TCl-lmage User's Manual, Part Two TCl-lmage Programmer's Manual

(18)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(19)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

APPENDIX A : TESTING THE PROGRAM, FIGURES

1. Dots

A 1.1 Unsharp image

A 1

.

2 Binary image from segmentat

i

on of unsharp image

A 1

.

3 Simulated image

A 1.4 Binary image from segmentation of s

i

mulated image

A 1

.

5 Reference

A 1

.

6 Size distributions

2.

Silt particles with tew branches

A 2.1 Unsharp image

A 2

.

2 Binary image from segmentation of unsharp image

A 2.3 Simulated image

A 2.4 Binary image from segmentation of simulated image

A 2.5 Reference

A 2

.

6 Size distributions

3.

Silt particles with strong branches

A 3

.

1 Unsharp image

A 3

.

2 Binary image from segmentation of unsharp image

A 3.3 Simulated image

A 3.4 Binary image from segmentation of simulated image

A 3

.

5 Reference

A 3.6 Size distributions

4. Two different backgrounds

A 4.1 Simulated image like fig. A 2.3 but with another background

A 4

.

2 Binary image from segmentation of simulated image (fig. A 4.1 )

A 4.3 Size distributions in relation with the backgrounds

.

5. Silt particles with different brightness

A 5.1 Unsharp image

,

grey value particles: 128 (1/2 black)

A 5

.

2 Simulated image (1/2 black particles)

A 5

.

3 Binary image from segmentation of simulated image (fig A 5.2)

A 5.4 Unsharp image, grey value partieles

:

192 (1/4 black)

A 5

.

5 Simulated

i

mage (1/4 black particles)

A 5

.

6 B

i

nary image from segmentation of simulated image (fig A 5.5)

A 5

.

7 Size distributions in comparison with black particles.

(20)

F

I

G A

1.1

UNSHARP

IMAGE

,It ,tt,",tl

,

I

.

,

.

,

••••,·,t"t'

',

.

' ',",",'

'.' •••,•••••

'I' ·tt·,.·.·

.

••

.

..

.

....

I',_",

.

t"t,

••, ••••

'•

.

•••

DOTS

16

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(21)

I

I

I

I

,'

I

I

I

I

I

I

I

I

I

I

'

I

I

I

I

I

I

BINAIRE

IMAGE

FROM

SEGMENTATION

OF

UNSHARP

IMAGE

."

•••••••••

••••••••••••

.' ••••••••••

.'••••••••••

• • • •

'.' •••••••••

•"

••" ,

••••••••••••

,' ••••••••••

F

I

G A

1

.

2

DOTS

17

(22)

'1

GJ

»

~

.

(.N (J)

--~

C

I

»

-l

-

I

I

;::~~~·:·::::·:::·:.:;::·~::;i·~;~i~.:;;:

rn

00

0

--0

;;~~I;t.{~%

...

_

1JIt.r

·

"

"

~i~~il~

~

0

»

-I

~.<'-::;·::::::;:~·:.:.::::~:~·.:::::\~~~i0·t~~,~·.. -.~,

"._

#!.$.~·

"':'

·

~

:'

.

~'!'::':'

:

·

1:

.

:

;-;}..t.:i':;"~

,

~*'~"

~

~~'~.:~

..

::

.

.

.:

:.

.

:

:

.:

:,;

~.

:.

CJ

:

_

:":

:

(f)

~~~jl:;:

:

:

;

:

:::~~;~·~

:~~~

~

iS

~~

' .

·:

:

:~t

·

:

·

··

~

r7'i

.~~}{

~i~

'.

1

;~

~

:

"

_.

·

.

~i

~~~

.:;

··

':~

~

mr .

r

'

::

,.~~

{:

J

:[~:.

,

·~

:

:

·

~~~;~:~:r~

.

.~

i

·

~~:

~

·

·~

i~~~~

~~

rn

~~·~~

(23)

---~-~~-~---~~-~--~-I

I

I

I

I

I

I

I

I

I

,

I

I

I

I

'

I

I

I

I

I

I

BINAIRE

IMAGE

FROM

SEGMENTATION

OF SIMULATED

IMAGE

."

•••••••••

.' ••••••••••

.' ••••••••••

.'••••••••••

• • • •

'.' •••••••••

•••

II "

.'••••••••••

.' ••••••••••

FIG A 1.4

DOTS

19

(24)

I

REFERENCE

." •••••••••

.' ••••••••••

.' ••••••••••

.'••••••••••

'.' •••••••••

• • •

••.•. " .

.'••••••••••

.' ••••••••••

FIG A 1.5

DOTS

20

I

I

I

I

1

\

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(25)

I

SIZE

D

I

STRIBUTION

S

I

N : 96 60 mean I

I

sigm I ft

unsharp

40

I

uL~

image

a. 213

I

13 7 B 6 diameter (mm)

I

I

613 N : 96 mean I sigm I ~i~

I

413

simulated

u L

image

'11 a.

I

20

I

6 7 B diameter (mm)

I

N : 96 60 mean I

I

sigm I 40

reference

I

U L ~ a. 20

I

0 8 6 7

I

diameter (mm)

,

I

FIG A

1

.

6

DOTS

I

I

I

21

I

(26)

UNSHARP

IMAGE

·

t

t-I

..

,

..

"

.

,.

..

J

,

t

.'-"

f

..

..

-~

I

,J

:iE-

.,

-

~

#

I

·

I

~

,

..

,

.

~

I

~

.

*

I

.

'

..

.

,

.

,

·

t

~ .1;

I

f

.

f:

~,

f

·t

11

I

*'

~

.

"

t

t ..

t-

I

..

....

,

t

,

.

#.

..

.

:

,

.

..

,

,

..

e

,

if

SILT PARTICLES

FIG A 2.1

WITH FEW BRANCHES

22

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(27)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

BINAIRE

IMAGE FROM

S

EGMENTATION

OF UNSHARP

IMAGE

~

~

,

#

t •

"

J

,

~

..

••

t

I

J

~ #

,

••

t

,

,

I

.

'

,

~

..

,

,

,

f

.\

,

t .

#

-..

t

, t

,

-•

.I

,

,

,

FIG A 2.2

SILT

PARTICLES

WITH FEW BRANCHES

(28)

SIMULATED

IMAGE

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

FIG A 2.3

SILT PARTICLES

WITH FEW BRANCHES

(29)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

BINAIRE

IMAGE FROM

SEGMENTAT

I

ON

OF SIMULATED

I

MAGE

-~

,

~

t

.,

tIl-

J

,

-

t

••

,

t

I

J

,

••

..

,

,

,

,

,

.

'

,

,

~

..

,

#

..

.\

,

t

~

...

, t

t

,

-•

~

,

FI

G

A

2.4

S

I

LT PARTICLES

WITH FEW BRANCHES

(30)

REFERENCE

-..

t

,

.,

t

,

J

,

t

I

J

••

-

..

,

t

4

,

,

.

,

.

'

I

~

..

,

,

.\

,

t

t

t ·

,

,

--

,

-•

..

~

,

I

,

S

ILT P

AR

TI

C

LE

S

FIG A

2

.5

WITH FEW BRANCHES

26

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(31)

I

,

I

I

I

I

I

I

I

I

I

I

I

I

I

I

,

I

I

I

SIZE

DISTRIBUTIONS

N :93 mean • 2.3:7 1.01 sigm :

o

10 diameter (mm) 20 40~--~----~--~--~N~:9933~--r mean: 2.~6 sigm I 1.02 u ~ 20 a.

a

10 diameter (mm) 20 N : 93 mean • 2.28 1.10 sigm : e 10 20 diameter (mm)

FIG A 2.6

S

I

LT PARTICLES

WITH FEW BRANCHES

27

unsharp

i

mage

simulated

image

reference

(32)

F

I

G A 3.1

S

ILT

P

AR

TI

C

LE

S

WITH STRONG

BRANCHES

I

,

I

I

I

I

I

I

i

'

I

I

I

I

I

I

I

I

I

I

I

I

UNSHARP

IMAGE

28

(33)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

,

I

BINAIRE

IMAGE

FROM

SEGMENTATION

OF UNSHARP

IMAGE

••

:

~ ~

.

".

..'

~,.

• ~. ",. •. ~, iK'

,

'"

4'j.

~

.. ~

',f

+ • ,

I

4,

,.

'" ...

,

j

,

i'·

It

,

tf

t .._

" ·

, • • tf, .,' ~, ''"

J '.

1/

I,

til,....

te·

"

J

W:t

f'-

f.

_+

«

,

lP

Jr.

"

i

f #.

J '

#

"f:...

:

"

t_,,'·

I

.,

'; ~ ,.

· ·j ...';',

I ." ·

4.J ..

,

"1

1,.

"'IJ

•.

...

" ~ ~

,

i#

..

• ...

..

"0/. .. __

'\!"

Cf

--

,

.

...

.

S

ILT

PART

I

CLES

W

I

TH STRONG

BRANCHES

F

I

G A 3.2

(34)

SIMULATED

IMAGE

I

I

I

I

30

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

FIG A 3.3

SILT PARTICLE

S

(35)

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

BINAIRE

IMAGE

FROM

SEGMENTATION

OF SIMULA

T

ED

IM

A

GE

~

.,

• T , •

I. __'

~,...~,"~.~,

i K

J

I

..,

,t

iJ

... '

'.'

,.

4

,.,

..

~ ... ' I

i'"

t •

,: ,

'..

,..,~I' •

C.

1/

ff, ,.' .:"

..

1 ',.

I,

,

tIIl'

'l

t

ft·

,'Jw~

fat

f

.•

+

«

. •

J"

t

t.

J.t

f -.

j'

,

j:t

·

r"

I

*"

I

#

.,

.; ~ • · 1 .'

j ~';',, ."

'i

J.

..JI

f

-'I

1-.

",

f \\

'

.. t

.t --( ~ ,

,#

~

...

"~... '.!"

0

at-

..

..

...

SILT

PARTICLES

WITH STRONG

BRANCHES

FIG A 3.4

(36)

REFERENCE

I

I

I

I

I

I

I

I

I

,

I

I

I

I

I

I

I

I

I

.1.

FIG A 3.5

SILT PARTICLES

WITH STRONG

BRANCHES

32

(37)

I

I

,

I

'

I

I

,

I

I

1

I

,

I

,

I

I

I

,

I

I

I

I

I

I

I

SI

Z

E

DISTRIBUTIONS

N : 207 mean I 2.27 sigm I 1.21

o

10 20 diameter (mm) U L

t.

N : 200 mean I 2.32 sigm I 1.20

o

10 20 30 diameter (mm) 40~--~-- ~--~---N : 207 mean I 2.24 sigm I 1.24 u ~ 20 Q.

e

20 30 diameter (mm

>

FIG A 3

.

6

SILT PAR

TI

CLES

WITH STRONG

BRANCHES

33

unsharp

i

mage

30

simulated

image

reference

(38)

SI

M

ULATED

IMAGE

LIKE

FIG A 2.3

BUT

WITH

ANOTHER

BACKGROUND

FIG A 4.1

TWO DIFFERENT

BACKGROUNDS

34

I

I

I

I

I

I

I

I

,

I

I

J

I

I

I

I

I

I

(39)

I

I

'

I

I

I

I

I

I

I

I

I

,

I

I

I

I

I

I

I

,

I

'

I

BINAIRE

IMAGE FROM

SEGMENTATION

OF SIMULATED

IMAGE

(FIG A 4.1)

..

~

..

,

t

"

~

j

,

,

••

t

I

J

,

-

••

#

t

(

,

.

,

.'

,

,

..

,

#

,

.\

,

t .

,

..

.

...

,

t

,

t

-•

j

,

,

,

FIG A

4.2

TWO DIFFERENT

BACKGROUNDS

(40)

I N : mean I 2.36

I

313 sigm ' 1.133

another

background

~ 213

(see FIG A 4.1)

I

ot· Q. Ie

I

13 213

e

Ie

I

diameter (mm)

I

I

413 N : 93 mean I 2.36 sigm ' 1.132

Î

IJ ~ 28

I

~

Q.

I

13 13 Ie 213 diameter (mm)

I

I

'

I

S

IZE

D

IST

RIB

UTIO

N

S

In relatio

n

w

i

t

h

t

he

backgro

unds

3

6

I

I

I

I

I

(41)

I

,

I

,

,

J

I

I

'

I

I

I

1

Î

,

I

I

I

I

I

t

I

I

I

UN

S

H

AR

P

I

M

A

GE

g

r

ey

vo

l

u

e

po

rtiel

es

:

12

8

(1

/

2

bloek)

.

_"

'"!'

t

Ii

.

~

t

·Ik ,

.

"

.

:

..

*

:

.

'

.

~

1

4'

:~

.

~

.

'

~.~

;

,

.. .~

.

,

.-v.

.~

,

J

:~.

:

,

.

"""j' ."

,.

.

.

'

.

~.

:.~.

:

t

·

·

t

":

(

/r

,

.

*

:

,

.

~

.

.~

.

..

:

.

,

::r '.~.

I

.

t.

.

,,

:

'.

.

,

.

.

.

.

.

:("!: ~: . ~ ~

*,

f

t

~

$

t

:~ '('. ~

:

J

:'

·t

/r

.

-

~

·

1

:0

I

••• of '1,:'

·

t

..;. '('

.

ir .~'.

·

11

#-

'.. ~ :~.

J

j

!~ '&

,

.

.

,

.

1.

~

.

SILT PARTICLES

FIG

A 5.1

WITH DIFFERENT

BRIGHTNESSES

(42)

I

I

I

I

"

I

I

I

I

I

I

SILT PARTICLES

I

FIG A 5.2

WITH D

I

FFERENT

BRIGHTNESSES

SIMULATED

IMAGE

(1/2

block

partieles)

38

I

I

I

I

(43)

I

I

BINAIRE

IMAGE

FROM

I

"

SEGMENTAT

I

O

N

OF SIMULATED

I

MAGE

I

(FIG A 5

.

2)

I

'

~ 4 ~ A

,

t

I

"

j

I

'

,

.4

f

,

I

J

I

4

••

,

f

t

,

,

I

,

.

'

,

4

,

I

,

..

#

,

f

.\

,

t .

I

...

t

I

,

, t

-I

,

~

I

I

I

F

I

G A 5.3

SILT

PART

I

CLES

W

I

TH D

I

FFERENT

BRIGHTNESSES

I

I

39

(44)

UNSHARP

IMAGE

grey

value

pa

r

ti

ci

e

s

:

192

(1/4

bloek)

-r .':' :0;X 0.''''

.

'

.

.

.

~:' ..... :~ r-.:.

.

,:

.

•.~ -r .,. .....

.

~:.

.'.

SILT PARTICLES

W

ITH DIFFE

R

ENT

BR

I

G

HT

NESSES

F

I

G A 5

.

4

40

'

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

(45)

_

'

.'

..

l1li)

~

,

_

.w> -

~

__

,

,

_

':

..

'

-

_

,

,

_

,

..

..

..

\

..

-

..

'1

_-C)

»

()l ()l

__,

I

0

,---..., -->.

_-<,

~

,.,

U)

...

I

,.,

U1

~

_-rïl

_-~ ;0

r-0-

e

rn

__,

_-

I

Z

0

»

lJ

0

__,

A ~

»

rn

CD :::0

-0

0

;0

__,

0

_---

(")

,

C) ~

r-

,--t-I

_o

»

rn

0

__,

Cf)

_-

C)

z

(1)

rn

Cf)

rn

'----'"

U1

Cf)

rn

Cf)

(46)

BINAIRE

IMAGE

FROM

SEGMENTATION

OF SI MU LATED

IMAGE

(FIG

A 5.5)

..

-•

t •

"

~

J

f

t

C

J

f

,

f

t

(

,

,

"

,

,

-

.

#

.\

,

.,

t .

~

...

,

t

t

,

-•

"

-

,

F

I

G A 5.6

SILT PARTICLES

WITH DIFFERENT

BRIGHTNESSES

(47)

I

SI

Z

E DISTRIBUTIONS

I

In

c

omponson

with

black

pa

rtic

les

I

40 mean : 2.36 sigm I 1.92

I

u ~ 20 Q.

I

I

9 9 19 29 diameter (mm)

I

mean I 2.32 30 sigm : 1.07

I

,

u ~ 20 Q.

I

10 0

I

0 10 20 diameter (mm)

I

Î

30 2.37 mean I

1

1 sigm : 9.98 29 u

I

...

.,

Q.

J

0 0 10 29

I

diameter (mm)

I

SILT PARTICLES

FIG

A

5.7

WITH DIFFERENT

BRIGHTNESSES

I

I

I

43

(48)

I

I

I

I

I

I

I

.

Î

I

,

I

I

APPENDIX B : PROGRAM DESCRIPTIONS AND FLOW DIAGRAMS

Descriptions:

B

.

1 PARTDIST.tip

B

.

2 2ndDERLEO

.

tip

B.3 iterative threshold programthrnsgm

B.4 remedcon.t

i

p

B

.

5 painUip

B.6 DISTR.tip

B

.

7 distpart.tip

B

.

8 meanrms

.

tip

B

.

9 plverdn

.

ti[

Flow diagrams :

fig. B 1 PARTDIST.tip

fig. B 2 2ndDERIVO

.

tip

fig

.

B 3 iterative threshold program thrnsgm

fig. B 4 remedcon.tip

f

i

g

.

B 5 painUip

(49)

B 1. PARTDIST.tip

The partiele size distribution analyzed directly from exposures is performed by the

TCLi-batch program PARTDIST.tip. The analyze occurs in two steps: first by the

batch program 2ndDERLEO and second by DISTR.

From an exposure consisting objects and background the program 2ndDERLEO

distinguishes partieles. The result is a binary image consisting only objects.

From this binary image the partiele size distribution is determined by the program

DISTR.

B 2.

2ndDERLEO. tip

The program 2ndDERLEO.tip distinguishes the objects from the background. Direct from the original image (exposure) the second derivative is determined with use of the laplace filter and the first derivative for reference areas to select the areas of 2nd derivative <0 by the objects.

Before finishing this program the result is finish oft. The foreground noise (for

example due by the details of the object), areas of 2nd derivative <0 by

background also fitted in the reference areas and objects which are connected at the edge of the image are removed.

46

I

I

I

I

I

I

I

I

,

I

I

I

I

I

I

I

I

'/

(50)

I

I

I

I

'

I

I

.

I

,

I

a

I

I

I

I

I

I

:

I

I

I

I

I

B 2.1

The course of

2ndDERLEO.

tip

Determinations of the properties of the objects for instance the surfaces (needed for determining the size distribution) and shape parameters with use of TCLi-standard modules is based on binary images in which the objects consist of foreground pixels (value = 1) and the background of background pixels (value = 0). 2nd derivative <0

The second derivative is determined with use of the laplace filter:

lapl r7 r2

r1: original image (exposure) r2: second derivative

That yields the second derivative for a given object in r2:

13

Segmentation with a threshold = 1

thresh r2 bt2

f

7

r2: second derivative; f: fixed mode;

bt2: bitplane;

1 : threshold value.

yields for above given object in bitplane bt2: 1

The pixel in bt2 gets value = 1 if the 2nd derivative

a

1, others O.

The pixels of the objects are 0 and have to be 1.Therefore these binary values are inverted with use of:

binv bt2 bt7

That yields tor the above given object in bitplane bt1 :

o

(51)

reference area (InbiJ) background(in btI) ~

I

I

I

I

I

'

I

I

I

I

I

I

I

I

I

I

I

I

-I

Reference areas:

The first derivative is determined with use of robert gradient filter:

robg r1 r3

r1: original image (exposure);

r3: first derivative.

Reference areas are got with use of iterative threshold:

thrnsgm r3 thr thresh r3 bt3 f thr

r3: first derivative;

bt3:bitplane;

thr: threshold value.

The threshold needed for fixed threshold is calculated with use of thrnsgm. This

module calculates it on basis on na-method and is iterative (see 83).

In bt3 the foreground pixels form reference areas.

Most of the reference areas have the form of a ring. The closed spaces within are

filled up by use of

paint bt3

In some cases the threshold are low enough for remainder background noise in bt3, usuallv 2 pixels thick or less.

These noise can be removed by use of

bopen bt3 bt3 2

Selection objects from the background.

Af ter inversion of bt2 (written above) the foreground pixels in bt1 come not only

from the objects but also from the background fluctuations (see fig. 4.2 and

below).

object (inbil)

The objects fit in the reference areas and the background not and is selected by

use of the binary and operator:

band bt 1bt3 bt1

Then the bitplane bt1 consists foreground pixels only from objects.

48

(52)

I

I

I

I

Finish off

- Not only the background but also the foreground fluctuates caused by the details of the particles. In the bitplane bt1 th is causes for some objects holes:

I

I

These holes are fiJI up with use of:

paint bt1

I

- There are also cases that areas of 2nd dertvative s 0 caused by the backgroundfluctuations lies 50 close that the little part also fits in the reference area.

That gives after selection:

I

I

I

object background

I

I

I

The number of the pixels of the background are very few and they are removed by use of:

bopen bt1

During running of this module the shape and the surface of the object do not change.

I

There are also one or more objects that are connected at the edge of the image.

These give a wrong image on the surfaces and also on the distribution. These objects are removed by use of:

remedcon bt1

I

I

I

I

I

49

I

(53)

I

I

I

I

B 3

.

Iterative threshold program thrnsgm

The threshold for segmentation of the reference areas is determined by use of

n

a

-method:

threshold

=

mean +

na

The

a

is the RMS of background fluctuations or noise and is determined with:

in which

I

_

1

N

x

=

-E

x

j

N

i_!

I

I

I

x.ipixels of background fluctuatlons

N : number of pixels of background

I

I

I

I

The whole first derivative image consists not only pixels of background noise but also pixels of signals caused by the boundaries between objects and background. Therefore the pixels of signals are not used for to analyze the threshold the basis of the iteration process.

B 3.1 Iteration process

The mean and the sigma are calculated over all pixels of first derivative image and then mean +

na.

By calculating also the pixels of signais, the mean and the sigma are greater than

those of the noise.

The mean and the sigma are calculated again, the pixels greater than mean +

na

are not used.

This process is repeated with new value of mean

+ na

until the difference with previous one is two or less. In this case the mean and the sigma are calculated over only pixels of background noise.

I

I

I

For the iteration process the value of n is chosen 3.

For background fluctuations which has a probability density function in a shape of normal distribution, 0.13% of the pixels of the background fluctuations exceeds mean+na.

Forsegmentation however the value of n is chosen twice: 6 instead of 3. It is for safety, because the really shape of the probability density function is unpredictable.

I

I

I

50

I

I

Cytaty

Powiązane dokumenty

Ciekawym zagadnieniem wiążącym się z tematem pracy są problemy adaptacji Polskiej Marynarki Wojennej do warunków brytyjskich, szczególnie ważne w pierwszym okresie

Warunkiem racjonalności funkcjonowa- nia podmiotów jest natomiast ekonomiczność i korzystność (Szołtysek, 2014). W literaturze dotyczącej znaczenia i istoty logistyki

kę prowadzącą działalność gospodarczą polegającą na oferowaniu towa- rów lub usług na danym rynku, zdolną do przekroczenia reguł konkuren- cji, bez względu na cel

Wszystkie (za wyjątkiem jed- nej) znajdowały się na terenie Królestwa Polskiego 80. U progu II Rzeczypospolitej koedukacja w szkolnictwie średnim była zja- wiskiem mało powszechnym

Stosunek autorów chrześcijańskich do sportu był często negatywny. O ile wcześ- niej apostoł Paweł używał metaforyki sportowej: życie porównywał do sportowych zmagań,

We wnętrzu sali na pierwszym piętrze znajduje się dziewiętnastowieczne biurko, przy którym pracuje głównie siostra bibliotekarka, a także kilka foteli umożliwiających czytanie

Using only the PSF approximation in the first iteration in [8], we present a novel iterative linear phase diversity (ILPD) method, which consists in iteratively collecting one

Na podstawie oznaczonych ilości mullitu, a także parametrów komórki elementarnej nie można jed- noznacznie wykazać wpływu uziarnienia surowców na efektywność syntezy minerału