Unit 5
Unit 5
For example, if it is known that the objects of interest in the image have
gray-level values greater than L1 we could create a binary image for
display as
FICuRE 6.1
~
I
~
.
•
•. ·-~ .
-..;
~~ ~•~
•
..-.s
~ .. .fl..
( b)
•
'!. ·--
(aJ TE~J ima~ of collagen fibers in a scer-Lissuc sample from a rabbit. u,garDt'nL
aL a ma~ni ficaLiou of appro.-cimaLcly x 30. 000. Scl' also Fi~urc 1.5. Inuu;c
cow-t.e'iy of C.13. Frank. Dl'pan.mcnt of Sur~Ery. lini"crsiLy of Cal~ary. Sec
Fi~rc 2.12 for the hi<1Lo~am of the ima~c. (b) Ima~l' in (a) lhr~holrll'd aL
i he ~ay ln·el of 1-SO.
Detection of Isolated Points and Lines
Isolated points may exist in images due to noise or due to the presence of
small particles in the image
1 1 1
1 8 1 (5.2)
1 · 1 1
The operation computes the difference between the current pixel at the
center of the mask and the average of its 8 connected neighbors
Straight lines or line segrnents oriented at 0°, 45°, 90°, and 135° may be
detected by using the following 3 x 3 convolution rnasks l8]:
1 1 1 1 1 2
2 2 2 1 2 1
-1 -1 -1 2 1 1
1 2 -1 2 1 1
1 2 -1 1 2 1 . (5.3)
1 2 -1 1 1 2
A line may be said to exist in the direction for which the corTesponding rnask
provides the largest response.
Edge Detection
One of the approaches to the detection of an ROI is to detect its edges
The first-order derivatives and the Laplacian relate to the edges in the
image
Gradients or derivatives measure the rate of change, and hence could serve
as the basis for the development of methods for edge detection
A limitation of the operators as above is that they are based upon the
values of only two pixels; this makes the operators susceptible to noise or
spurious pixel values
The Prewitt operators take these considerations into account with the
following 3X3 masks for the horizontal and vertical derivatives Gx and Gy,
respectively
-1 0 1
Gx. : 1 0 1 . (5. 7)
1 0 1
1 1 1
0 0 0 (5.8)
1 1 1
The Prewitt operators use three differences across pairs of pixels in
three rows or columns around the pixel being processed
In order to accommodate the orientation of the edge, a vectorial form of
the gTadient could be cornposed as
where
(5.10)
and
(5.11)
If the magnitude is to be scaled for display or thresholded for the detec-
tion of edges, the square-root operation may be dropped, or the magnitude
approximated as IC fx I+ IG fy I in order to save cornputation.
The Sobel operators are sirnilar to the Pre,vitt operators, but include larger
weights for the pixels in the row or column of the pixel being processed as
1 0 1
Gx.: 2 0 2 (5.12)
-1 0 1
-1 -2 -1
Cy: 0 0 0 (5.13)
1 2 1
Edges oriented at 45° and 135° may be detected by using rotated versions
of the masks as above. The Prewitt operators for the detection of diagonal
edges are
0 1 -1
G45° : 1 0 1 (5.14)
1 1 0
and
G 135• •. Il 1
1
1
0
01
(5.15)
0 1 ~J
Similar masks rnay be derived for the Sobel operator.
Observe that the sum of all of the weights in the masks above is zero
The masks are positioned with the upper-left elen1ent placed on the pixel
being processed. The absolute values of the results of the t\vo operators are
added to obtain the net gradient:
(c I ( <l I
FIGl.iRE 5. 2
(.ll SLJ.J,Jt"~ t ..... t iui.J._,;t". (L:1 G.a ...<lit"ut ui..u.;uit1YJt". di,v1..._.. I.LU-.t"
"· 'l"t,!1 . (C:1 H~11,mutJ.l <lt"! i\oiti·,t". di-.vl.i-" 1u.ui.;t"
'°· JOO .)Ut ..,f
2.,.,_ 2.,., .out of I 'l"tt!t. 'l"ti!, .
(<l·1 Yt"l ticJ.l dt"l i ....1ti,.,. di-.J.JL-" 1.1u.;t" 200. 200 -ut - f 'l"tH1. 'l"t.!1 . (t!l J!, 0
<lt-,i•,J.ti, ... di---vL.... 1.u~.;.- 2, ....,. 200 out of I 'l"t.!1. 'l"tH,. cr:i 1:i!, <lt"!h.1ti, ...
0
(t' I (f I
FJGwRE 5.4
f.1l Kut.•t' ~JR iwa;;t'. (Ll G1.1(lst'11l u.a\:,u1tu:! ... di-.µJ.L_\ 1.uJ.;<' ~). 100 oul uf
,,.ti9.:< . lt:J Hu11.1.~u1.J c!CJ I\J.ll\C. cli-.pl.1,; 1.u,i;c luv. 1,,.. uul ~r a9t,. 191>.
f d) v..1 I ical d ..1 I\ al IVC. di-jJI.L) I LU,.,.. .!vu. :?.,., out c.f IH -:. Ml!!- . ft• J 1?1°
d!'JI', Lll',t'. w~..,h.:, I.LU>,;C 2,nl. lll\, ' I l l -f .,lil.!n,:i. ffJ 1:i!, 0 c!,•11\.LlH't'.
<11,-µla_.,, lJ.JJ'tt' .!vu. 2...u >ul ,.r t~i.!.!J.!tl.
The Laplacian of Gaussian
Although the Laplacian is a
gradient operator, it should be
recognized that it is a second-
profile of edge order difference operator
Lf
fin:t derivative
negative values at each edge
cecond derivative
FIGURE 6.6
Thp to bolt.om: A profile of a blurred object showin ~ two ed~es. the first
deri\'ali\'e. and the second deri\'ali\'e (see also Fi~ure 4.26).
The Laplacian has the advantage of being omnidirectional, that
is, being sensitive to edges in all directions
The property holds even when the edge in the original image is
significantly blurred
~ .
Consider the Gaussian specified by the function
x2 + y2) (5 .18)
g(x, y) --;; • exp ( - 2 a-2 •
The usual norrnalizing scale factor has been left out. Tdking partial derivatives
with respect to x and y, \Ve obtain
a2g X
2 2
x2-y2)
- 0'4
(1
2 (12
8x 2
a2g y2 O'
2
ay2 - 0'4
(5.19)
\Vhich leads to
r2 2 a2 ( r2 )
v1 2g(x,y) - LoG(r)--= 4 exp ' 2 , (5 .20)
(J 2 (J
(c) (d)
(e) (f)
FIGURE 6.7
I'hc Laplacian of Gaussian in (b) ima~c formaL and (cl) as a mesh plot.. I'he
related Gaussian functions are shown in (a) and (c). rhc size of the arrays
is 51 x 51 pL~els: standard de·dat.ion a 1 pL~els. rhe Fourier ma~nit.ude
spectra of the funclions are shown in (c) and (f).
Canny’s method for edge detection
Canny proposed an approach for edge detection based upon
three criteria for good edge detection, multidirectional
derivatives, multiscale analysis, and optimization procedures
Canny’s method could lead to better results than the LoG filter
Fourier-domain methods for edge detection
Highpass filters may be applied in the Fourier-domain to extract the edges in
the given image
Thresholding methods are based upon the assumption that all pixels whose
values lie within a certain range belong to the same class
The threshold may be determined based upon the valleys in the histogram
of the image
However, identifying thresholds to segment objects is not easy even with
optimal thresholding techniques
High values of the output provide candidate pixels for region boundaries,
which must then be processed to produce closed curves representing the
boundaries between regions, as well as to remove the effects of noise and
discontinuities due to non-uniform illumination and other effects
where 111 aud 112 arc the 1uca11s of the two rcgious, aud a1 aud a2 arc their
staudard dcvi atious. Let µ1 < Jt2.
Supposr that the dark rrgious iu thr in1agc corrrspoud to t,hr backgro1111d,
aud thr bright regious to the obj rcts of interest. Ihcu, all pixrls brlow a
threshold I 1uay br cousidcrrd to bcloug to thr backgro1111d, aud nll pixels
abovr r 1uay br cousideird as pixels bclougiug to the obj cct, of iutcrrst. The
probability of erro11rous classification is theu
-oo
p2( i) dx. (5.30)
(5.31)
Applying this result to thr (jaussia11 PDFs gives (after takiug logaritb111s and
sowc siwplitication) the quadratic equation _8_
A.T 2 HT - (1 0, (5.32)
where
.A : (J2l (J2
2'
(5.33)
The possibility of two solutious indicates that it niay require two thresholds
to obtain the optinial Uu·cshold.
lf ai =ai =a~, n si11glc f hrrghold 111ny be u~rd, gi vc11 by
?
1' = /11 J. /12 .1. _a_-_ In 1'2
2 /11 /t2 /'1
l111rf hrnuorr, if f,hc fwo prior probabilitiirg nrr rc1ual, tihnt. iq, 1'1 =1'2, or if tihr
vnrinucr iq zrro, thnf i~, a =0, f hr. opti111al fhrr.shold i~ cc1unl to f he avrrngr
of f hr two 111rn11q,
Thresholding using boundary characteristics
The number of pixels covered by the objects of interest to be segmented
from an image is almost always a small fraction of the total number of pixels
in the image the gray-level histogram of the image is then likely to be almost
unimodal
The histogram may be made closer to being bimodal if only the pixels on or
near the boundaries of the object regions are considered
The selrctiou aud charactcriiatiou of the edge or bouudary pixels 1uay be
achieved by usi11g gradic11t aud Laplaria11 operators as tallows _8 :
Lrt ll rrprr~rut thr rrgiou ~p~u111i ug th r rutiJr ~pace of thr gi "eu i111 age.
Srg111ruf nt iou 111ay be virwrd a~ n procr~~ that part it ious 11 iut.o n ~ubrrgio11s
ll1,lf.2, ... ,l(,1 such that _8_
• U? 1JI, = ll, th at i~, thr u11io11 of all of thr rrgio11s drf rct rd spau~ t hr
rufirc i111ngc ( f hr 11, evrry pixr l 11111 ~f beloug fio a rrgio11);
• ll; n lf. j = l~ Vi, j, i 1 j (that i~, thr rrgio11~ arr di~j oi ut);
• P(lli) = TU( I}!;, for i = l, 2, ... ,11 {for rx~uuplr, all pixrl~ withiu a
rrgio11 hnvc thr qmuc i11tr11qifiy );
• P(U, I Uj) =F.4.LSE ~'i,j, if. j {for rxn111plc, fhc iufruqifirq of the
pixrl~ i11 diffrrruti rrgiouq arr diffrrrut);
whrrr P( H,) iq a logical prrdiratr drfi11rd ovrr f hr poiufig i11 thr grfi U,, a11d
0iq thr uull sot
A siu1ple algorithu1 for regiou growiug by pixel aggrcgatiou based 11pou thr
sin1i lari ty of a local property is as follows:
Because the splitting procedure could result in adjacent regions that are
similar, a merging step would be required, which may be specified as
follows:
The method compares the properties of spatially connected neighboring pixels with
those of the seed pixel, the properties used are determined by homogeneity criteria
For intensity-based image segmentation, the simplest property is the pixel gray level
The term “additive tolerance level” stands for the permitted absolute gray-level
difference between the neighboring pixels and the seed pixel
2 3 4 5 2 3 4 5
111111■■111
2 100 100 2 100 127 126 128 100
100 3 100 124 128 127 100
101 4 100 124 125 126 101
5 101 102 s 101 ■■Ill.
(c) (d)
FIGURE 5.17
Exaruple of additive-tolerance region g1·owing using different. seed pixels (T -=
3). (a) Original image. (b) The 1·esult. of region g1·owing (shaded in black) with
the seed pixel at (2, 2). (c) The result of region growing with the seed pix.el at.
(3, 3). (d) The result. of region growing with the running-wean algorit.hru or
the Hew-rent. cent.er pixel" ruet.hod using any seed pixel within the highlighted
region. Figw·e cow·t.esy of L. Shen _320_.
Figure 5.17 shows a simple example of additive-tolerance region growing
using different seed pixels in a 5X5 image
Observe that two different regions are obtained by starting with two seeds
at different locations as shown in Figure 5.17b and Figure 5.17c
Instead of comparing the incoming pixel with the gray level of the seed, the
gray level of a neighboring pixel is compared with the mean gray level,
called the running mean µRc, of the region being grown and its current
stage Rc
This criterion may be represented as
(5.37)
where
(5 .38)
Figure 5.17d shows the result obtained with the running-mean algorithm
by using the same additive tolerance level as before (T=3)
In addition to the sensitivity of the region to seed pixel selection with additive
tolerance region growing, the additive tolerance level or absolute difference
in gray level T is not a good criterion for region growing
f_(n_i_,n_)_I-L_R_cl < 7
_I
(5.40)
or
,vhere f (rn, n) is the gTay level of the current pLxel being checked for inclusion,
and µRe could stand for the original seed pixel value, the current center pixel
value, or the running-mean gTay level. Observe that the t,vo equations above
are c.:ornparable to the definitions of sirnultaneous contrast in Equations 2. 7
and 2.8.
The additive and rnultiplic.:ati ve tolerance levels both determine the rnaxi-
mum gray-level deviation allowed within a region, and any deviation less than
this level is considered to be an intrinsic.: property of the region, or to be noise.
1\IIultiplicative tolerance is rneaningful ,vhen related to the SNR of a region (or
image), whereas additive tolerance has a direct connection with the standard
deviation of the pLxels within the region or a given image.
Analysis of region growing in the presence of noise
In order to analyze the perforrnance of region-gro,ving r11ethods in the presence
of noise, let us assur11e that the given image g n1ay be r11odeled as an ideal
ir11age f plus a noise ir11age T/, where f consists of a series of strictly uniforrn,
disjoint, or nonoverlapping regioru; Ri, i - 1, 2, ... , k, and T/ includes their
corresponding noise parts ·ryi, i - 1, 2, ... , k. 1VIather11atically, the in1age rnay
be expressed as
g - ft T/, (5 .42)
,vhere
f- LJ Ri, i --= 1, 2, ... , k, (5.4:~)
t'
and
T/ -= ui
TJi, i-1,2, ... ,k. (5 .44)
A strictly uniform region Ri is composed of a set of connected pixels f(m, n)
at positions (rn ) n) \vhose v·tlues
CJ equal a constant K.· that is
t) )
The set of regions Ri, i - 1, 2, ... , k, is \vhat \Ve expect to obtain as the
result of segmentation. Suppose that the noise parts rJi, i - 1, 2, ... , k, are
cornposed of \Vhite noise \vith zero rnean and standard deviation ai; then, \Ve
have
g - LJ(Ri + rJi), i-= 1, 2, ... ,k, (5 .46)
t
and
f - LJ Ri - g LJ 'l'Ji, i -= 1, 2, ... , k. (5 .4 7)
t i
As a special case, \vhen all the noise cornponents have the same standard
deviation a, that is,
(5 .48)
and
(5.49)
,vhere the syrnbol ,,.,.., represents statistical similarity, the image f may be de-
scribed as
LJ
g ,,.,.., Ri + TJ, i - 1, 2, ... , k, (5.50)
i
and
f - LJ Ri ,,.,.., g - TJ; i --= 1, 2, ... , k. (5.51)
i
(5.52)