1
I
I
1-1
1
I
1-I
I
1
I
I
I
I-
TU
Delft University of TechnologyDelft
I
Department of Civil Engineering
Hydraulic and GeotechnicalEngineeringDivision HydromechanicsSection
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
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
CONTENTS 1. INTRODUCTION1
2. PROBLEMS2
3. METHODS3
4. TESTS9
5. RESULTS10
7. LITERATURE14
APPENDICES:A: TESTING THE PROGRAM, FIGURES
15
B: PROGRAM DESCRIPTIONS .
45
Descriptions Flow diagrams
46
60
C: TESTING MODULES OF THE PROGRAM, FIGURES66
1. Comparison isodata threshold program with thrnsgm. 672. remedcon.tip 77
3. paint.tip . 81
I
I
I
I
1. INTRODUCTIONI
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
12.
PROBLEMSI
I
I
I
Several features of the exposures of cohesive sediment flocs disturb the imagesof 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
to3.4.
I
I
I
I
I
I
I
I
I
I
I
I
I
I
2
I
I
--- ----I
I
I
I
3.
METHOOS
I
I
I
3.1 SegmentationThe 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 1I
I
I
UI UI.,
c s: .g' .DI
/
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 backgroundI
I
figure 3.2. A plot of the first order derivative of brightnessof the imagein tig. 3.1 (absolute values).
3
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 backgroundI
I
I
threshotdI
Iocctice___.i
I
I
I
ctcceofthe skeletfigure 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
4I
I
I
I
I
I
1
I
I
I
I
I
I
I
boundary lhreshold object background ERROR locolion --_. olace of the skeletfigure 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
_
~.,
o ., ., "0 ., Cl) ~ C "00-=> .&:. - "0 0-.- C' -e O.D g'u E <>_.,0 <> ~ o > .~ 0 "0 boundoryobject
I
I
I
I
locotion --_.. nd 2 derivotive = 0I
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 v1
/
\
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
I
I
I
I
r
ob,iKt1 object 2 reler.nee areasI
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 backgroundr-.L
I I L II
I
reference
a rea s :
fill
up
holes
in
reference
areas
I
I
r---I I L __ _Iselected
areas
of
2
ndderivctive
. .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
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
I
I
I
I
I
I
I
4. TESTSI
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
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
- ---
-I
I
I
I
distributions, the only significant difference lies in the area between
0.5
and1.5
mmo The mean is decreased from2.37
to2.36
and the sigma increased from1.01
to
1.02,
both less than1%.
The resulting total deviation from the reference amounts to
3.5%
for the mean and7.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, between0.0-0.5
mm the percentage is decreased from37%
to28% ,
between0.5-1.0
mm and1.0-1.5
mm respectively increased from7
to13%
and from3.5
to6%.
Secondly,objects above 5 mm are not found any more. Consequently, the mean value is increased from
2.24
mm to2.27
mm(1
.
3%)
and the sigma is decreased from1.24
mm to1.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 from2.27
to2.32
mm(2.2%).
The sigma is hardly changed:1.21
to1.20
mm(0.8%) .
The resulting total deviation from the reference amounts to
3.6%
for the mean and to3.3%
for the sigma, mainly caused by the unsharpness.5.4 Different background
I
I
Comparing the binary images fig. A
4.2
and2
.
2
visually yields that for over50%
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
and1.0
mm (fig. A4.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 to1/2
maximum brightness): The particles in the binary images (fig. A2
.
4
and5.3)
visually differ generally about2
pixels, mostly they are smaller in A5.3.
For30%
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 from2.36
mm to2
.
32
mm, about2%
(fig A5.7).
The sigma increases from1.02
mm to1.07
mmoCompared with the reference these values deviate respectively
1.8
and2.7%.
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
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.
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
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
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 branchesA 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 branchesA 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.
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
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
'1
GJ
»
~.
(.N (J) --~C
I»
-l-
I
I
;::~~~·:·::::·:::·:.:;::·~::;i·~;~i~.:;;:rn
000
--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
~~·~~
---~-~~-~---~~-~--~-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
I
REFERENCE
•." •••••••••
.' ••••••••••
.' ••••••••••
.'••••••••••
•
'.' •••••••••
•
• • •
••.•. " .
.'••••••••••
.' ••••••••••
FIG A 1.5
DOTS
20I
I
I
I
1
\
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
SIZE
D
I
STRIBUTION
S
I
N : 96 60 mean II
sigm I ftunsharp
40I
uL~image
a. 213I
13 7 B 6 diameter (mm)I
I
613 N : 96 mean I sigm I ~i~I
413simulated
u Limage
'11 a.I
20I
6 7 B diameter (mm)I
N : 96 60 mean II
sigm I 40reference
I
U L ~ a. 20I
0 8 6 7I
diameter (mm),
I
FIG A
1
.
6
DOTS
I
I
I
21I
UNSHARP
IMAGE
·
t
•
t-I
..
•
,
•
..
"
.
,.
•
..
J
,
•
t
.'-"
f
..
..
-~I
,J
:iE-.,
-
~•
•
•
#
I
·
I
~,
..
,
.
~
I
~.
*
I
•
.
'
..
.
,
.
,
•
·
t
~ .1;I
f
.
f:
~,
f
·t
11I
*'
•
~
.
"
t
t ..
t-I
..
....
,
t
,
.#.
•
..
.
:
•
•
,
.
..
,
•
,
•
..
e
,
ifSILT 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
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
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
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
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
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
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
28I
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
SIMULATED
IMAGE
I
I
I
I
30I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
FIG A 3.3
SILT PARTICLE
S
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
JI
..,
•
•
,t
iJ
... '
'.'
,.
4
,.,
..
~ ... ' I
i'"
t •
,: ,
'..
,..,~I' •
C.
•
1/
•
ff, ,.' .:"
..
1 ',.
I,
,
tIIl'
'l
tft·
,'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
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
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.21o
10 20 diameter (mm) U Lt.
N : 200 mean I 2.32 sigm I 1.20o
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
30simulated
image
reference
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
JI
I
I
I
I
I
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
I N : mean I 2.36
I
313 sigm ' 1.133another
background
~ 213(see FIG A 4.1)
I
ot· Q. IeI
13 213e
IeI
diameter (mm)I
I
413 N : 93 mean I 2.36 sigm ' 1.132Î
IJ ~ 28I
~
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
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
:0I
••• of '1,:'·
t
..;. '('.
ir .~'.·
11
#-
'.. ~ :~.J
j
!~ '&,
.
.
,
.
1.
~
.
SILT PARTICLES
FIG
A 5.1
WITH DIFFERENT
BRIGHTNESSES
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)
38I
I
I
I
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
UNSHARP
IMAGE
grey
value
pa
r
ti
ci
e
s
:
192
(1/4
bloek)
-r .':' :0;X 0.''''
.
'
.
e».
.
~:' ..... :~ 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
_
'
.'
..
l1li)
~
,
_
.w> -
~
__
,
,
_
':
..
'
-
_
,
,
_
,
..
..
..
\
..
-
..
'1 _-C)»
()l ()l__,
I
0
,---..., -->._-<,
~,.,
U)...
I
,.,
U1
~ _-rïl _-~ ;0 r-0-e
rn
__,
_-
IZ
0»
lJ
0__,
A ~»
rn
CD :::0
-00
;0__,
0_---
("),
C) ~ r-,--t-I
_o»
rn
0__,
Cf)_-
C)z
(1)rn
Cf)rn
'----'"U1
Cf)rn
Cf)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
I
SI
Z
E DISTRIBUTIONS
I
In
c
omponson
with
black
pa
rtic
les
I
40 mean : 2.36 sigm I 1.92I
u ~ 20 Q.I
I
9 9 19 29 diameter (mm)I
mean I 2.32 30 sigm : 1.07I
,
u ~ 20 Q.I
10 0I
0 10 20 diameter (mm)I
Î
30 2.37 mean I1
1 sigm : 9.98 29 uI
...
.,
Q.J
0 0 10 29I
diameter (mm)I
SILT PARTICLES
FIG
A
5.7
WITH DIFFERENT
BRIGHTNESSES
I
I
I
43I
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
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. tipThe 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
'/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 of2ndDERLEO.
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
f7
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
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
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
I
I
I
I
B 3
.
Iterative threshold program thrnsgmThe 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
Nx
=
-E
x
jN
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.