0 ratings0% found this document useful (0 votes) 295 views53 pagesDIP Unit-4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
_ ONIT -V
IMAGit SEGIMENTATION
Image seqmenlation has crneaqedl a ar ivepesxtant
phase in image-based applications Seqmentalion is the
process of Partitioning. a digital wage into nulliPle
-gegions and extracting a Heaning-full vegion Kroon
as the vegion of inlevest (Ror). Regions of interest vary
joorlh applications
Detection of vison muilies
the thee basic types of quay level discontinuities
iin ckigidal irnage ate the ellocirg.
| | Poinls
4. Lines
3. £elges
An téoloted point is a pommt whose gray level ts
backqxourcl ma homage-
2
_ Significardly, diffesent foo ils
neous anca. A genexic 3x3 spatial yn mask 48 Shown
in below fig (a+
z leolza |
[= [zz [2s]
74 | 2516 |
11 | % | 29
spatiol Mask
Fig(a) * geneaic 3x3
I
ee onik-& | 1153Se ee
\| she Mask jo Supey wmposed orto an wage and the
lGonvelution process 18 applied. the vesporse of the Mask
7
iS given as,
R= 2 2h, \|
where , the f, Values axe the gray level voluies of the |
Pixels associated with the image -
A dhyeshold value T is used to .
dendify» the Me poinls. a Point is said i 4 : |
to be detected at the location on which | ( [4 |
the Mask 1 Céntyed if IRIZTs . =
Mask volue of
where 'T? 45 a won —negative inteqea’ The
a point detection Mask al points.
@)line petection:—
ae ee
x the next level of complerity 39" Line detection”
* G@nsider, the Masks Shown below. these axe used
fon the line detection. ;
: i : be
Fh |! 2) Jaleeel [ey--|
> jee eee ee
ler Q | [-1[2 -I il a|-w|
| - : {al -1Pa|
ee eee ee
| Hoxiaandal + 45° vertical 45°
veike & ¢ BI3
‘ett the fivst ae ee = a,
i were moved atound an ima! il
| image, 7
| would yespond mone shrorgly» do fin ay
| hosigentally mes garerde
eee na back quourd , the Max. xspanse wculd
| | when the line passed thyough the vdle 3002
= 7 Mosk: his 19 easily veaifted by stelchings
a evey of 13 wilh a line of 0 deffexent 93a4- |
eee (say, 5's) semningy hoyiaentally bhvougyh 2
ng # ar mask yesponds best 4o lines
|
|
ontented at 45°, the
94 ask fo vertical lines and the 4th mask to lines
} "ys? dixection.
“These divections can be established also
|
| the pueffcved direction of cach mask
coefficient City 2) than othe possible discetions
| a bager
«wile that, the o- efficients
yesponse
by noting’ tak |
9 weighted osth |
in each’ Mask stm £0 re, |
|
mndicalingy 4 7020 fsorm the Masks in anttas
2 of a@nstant gray’ :
ard Ry denote
left to Right |
fae Yun individually
Jevel - |
ied lef Ry Ra oR Lhe sesponses of the Masks
to above — figure , form
‘x suppose that the four Mask?
{hyough 9” gmage
an the image ’ IR] IRL ysl,
a pat a cextain point
} es gid fo be More - likely associated with |
q fne in Ihe disection of Mask ‘1’.Ext- rh at a pond tn the tage, IR) 7 IR;) fox
point 15 said fo be
p22.3,4 that particular
wilh a besizental line
more likely associated
interested in detecting all the [ines in
*% we ate
defined by a diver Mask,
an tmage 'M’ the direction
Lhsoegh the mage ard bhicshely
we simply run the Mask
the absotuke value of the aesull
RX the points that are lef we
which , for lines one Pixel
lo the dixection defined by
An “Edge” +5 a set of Connected prwels that lic
on the boundary bhy two vegions
image, an édge 15 a lecal fealuse
two yegjons im
the strongest 2esPonses
Lhick » correspond closesé
fhe Hask- e
Tha qxay~ scale
that | within a neighbouthood , separates
each of cshich the guay - level 45 mose (ox) Jess uniform
with different values or the two sides of the edge. &
dioilal €dee
nodal of an ideax the lhickness of the edge % delexmined py the
length of the somp, as it faansilions fyorn an dinilal
length 45 delesnined Vy The
hy, dhe degree of
to a firal qoay-level. the
slope. which a 4rtann , $5 delexmined
blwecing
# Blovred elges tend to be thick and shasp eclges tere
fo be thn
de the below figure (a) shows the image from eahich figtb)
qwas erdyacted -
= ty th) shows a hositontal qyay-level paofile of dhe® edge
bo the {wo yegions.
# the Magnitude of the fiast devivedive *
presence
Grway-level
Can be used bo detect the
of an edge af a poimt tn an image profile :
(ee) do determine fa Point 16 07 : ‘frase
ae dexivol ve
a yams
# [lay , the stan of the Second dexivodive |
fan be used to
delearnine » whethe x
|
=|
|
an edge piel ties in the clavk (03) t
fight side of an edge oa
\
the 2 puopentics of the second devivetive
ayound gn ecge-
Jwo values for © tn an tage
i) rh produces vey” ae
| fan ures sible Seatwres j- and
|i An jag inet line
and “ve! values
yy straight goin the a extaeme ‘pve’
of the second de yivative ovuld cxoss |
|
nite & ) S1530b
zero viecay the mid-point of the edge» This poopesty |
$s known as "1010 - Cx098inq propeat”- qhis paopesty 15
cuiolely used for focaling the conters of thick edges
edge defination 19 dhe most Common Lechnic for
definatingy discontinaties in infensity values the vawious
edge lefenalions available in function edge ane @ follows
Is Robexts edge detector
, pavadient ope vatos S
2. paewill's edge detecto*
3. gobe] edge detector’ -
4. Laplacian of a Gaussian edge detector
5. 7x0 - Grossing» detector
€+ Canny -edge delecloy
(0 Swaclient apezes
| fissk -oxdex derivatives of a digital image o%¢ based
(on yevctous approximations of the ap gaadient- the
| grodicnd of an tmage frog) ak location Oy) 15 defined — gym
| as the vector
f
vt = [e] : »
ony we [70
fy
* for edge defection, we have fo consider the Magnitude
of this vector ,deroted vt ), where,
Ne] )
af-af-| salolt |
| pe | o lo | a] ol! i
| vpn alold
| fox # fos 2 35
(* In this formation, the diff bay the fixst and Lhivd ||
| Yows of the 3x3 image vxegion appro xemates the
| deyivative in the x-divection (y-dtyection )
\* the prewilt delector +3 Some whal easjey to execute |
the sobew detector . bat A genesate|
|
| Gmpatationally an
I
| shghthy neisey veselts | ape
al Jobe! edge detector: - |
the below figene shows dhe masks used by a
sober elge detectow to estimate bx and Sty |
}
| Gx = (274 2rg t tq) ~ (% ARWet%3)— (9) |
| Gy = (tat Q264tq) ~ (2 @2y 427) CD)
|| -
| x weight value of (2) i used 0 achieve Some Srool bing
| by givinge move importance to the centex powd
|
ton uy, 3153Prewdl
— Sebo
(3) Laplacian opexators :-
ORAS RT
3
| yotation
the laplacian of a a-p function flxy) 13 a second
oxdex derivative is defined as
vs: a 3, lo)
for a 3x8. vegion, one of the devo fowrns enceunteaed
[Host facguently, in practice 15,
VS = 495s— Grazys 47g)
A digital appacuimation sneluding, the diagonal
neighbours 75 aver by,
vi = 8t5- Gar gap te 4tur?
ant Shown heae
121478 +2qg) 22
my these #00
for implement
eigns @ (R) ant
* Masks
ss0taoPic
the amplementation of the
ancuernerts of ag ard us respectively.reer ernnaaeeaaeeeeeeeraa
the laplacton gene vlly-
| form — fox" edge detection
| she laplacian 49 Combined wi
Precursor 40 finding, edges via ze vo - CxOSIMGS
Gnsider the fanction |
45 nok used in its 0%54 nal |
seveval yeasore
th Smoothiny 05 a
for
Povten ata |
where yy" ev4y* and be" is slandostd dewiation |
# Grvolvingy this fn with an irnage Huts dhe image, with |
|
the deqeee of bluxcing, beiny determined by dhe vake
| oF fe’.
| |
the (laplacian of bn! 15
GG SMe Yho)
bx dy
|
whe) = PT ra] -Vas* |
ot é ty) |
| qhis function 18 commonly de reffered to as |
} laplacian of a Gaussian (Loc ) because ¢9'n (3) 18 im the =
| form of Graussian f'n. |
| tthe below figuve shows cxoss - section of the log
| fin. gue fo ls shape » the lag, sometimes is cated |
| the Mexican tat function
Unie WlS3a) Cv035- Section showings
~3 2ex0 C¥0ssings
4) zeae - Cuossing, dedecto2'-
RA AA ann
This delecloy 1 based on the same ide
othe diffesence 15, in this delectox , the
log, detector
Convolution
5) Canny edge delectos:-
This is the Most pouesful od
15 pexfosmed usingy a specified filles SH
oO |-! =a ate
fuqea| wf-a|
| | |
po jot {als o |
fofe lle fe |
b) 5x5 Mask appacximation fo
the shope of the 39 image cha
a as the
et
ge detectors supplied
=> by the fn edge the procedune employed bp Commyy
edge detecton 1 cullined below -
1) the trage
tg smothed using» Goussion files cwith
a specific 40 seduce noise.
ii) the Local distance qyadient 9 0uy)= Te reat andl
edge dtveclion 0047= tai" (ZE ) ate evaluated af
cach poinout "Gobet" ov © froyett*
% Robods’
onit-t 531a
deleclos Can be used to calculate Gry’ ane ony?
| edge
be a poinl whose Strxerqlh
| An edge point 43 defined fo
[1 beallyy Max. tn the discelion of graudi
| tii) the edge point delesmined in Step ci? give vise to
Vay tn the — qradout Magnitude image the algosthm
then racks along the fop of these xidges and sels &
Zevo all pixels © that ane not actually on the widge top
S as fo gue a thin tne in the op, a process known
9 " Non - Maximal Suppsession’ =
The yidge pixels ane then thresholded using,
foso Lhyesholds T and T2 with T«T2 - Ridge Pixels
with values qreatey than 't,'. ane gaid to be strong,
Cdge pixels Ridge Pixels with values blw Ty and
Said fo the « weak" edge Prvels.
Finally, the algorithm performs edge hindhinge by-
‘incoxpanting- the weak Pixels ane $-Cormecked to a =
Strong, pixels.
bnik-4, 12 [53_ Edge linking? and boundosy» eet
eee fe crrtacae wee
Fdge linking, procedure ts used to place edge
Pyxels into meaning fall edges.
the different Methods for edge linking, axe follows
1) local processing,
1) Global processing, vio the Hough sansfoam |
tii) Global processing» via the qaaph thesomlic lechnigucs
= 7? Local Paocessing :-
Jn lscal processinge the edge linking» cawvicd |
by, foo methods
othe stxength (wognetude ) of quadient opexator
to produce edge pixel:
2. Gradient vector dxeation
co-osdtvoles of cdge Pixcb 05 C*or¥o)
ig Used
Qansider the
2 and the co-oxdinates of high - pixel 05 (oY)
the Magnitude of 6dge pixel and nighloowred Pte]
in?
whe ny
Ivf Coy) - Cot Gordo) [EE
wheve, € vepsesen’s von - negative threshold
the yangk of edge Pixel and nghbouned Pre!
Same — when
onit-&, 13/53TR (x. W~ 2 C140) [ZA
where, A> yen -negative angle threshold
# the direction of fhe edge af Gey) nigh
ts Ped fo the pixel at Coy) tt both
bounced of (ry)
Magnilude
ard dixection criteria bat wte satisfied . this process
15 vepeated every location in image
Global processing» via the Hough Tan stoxms :-
Tn this processing» when the points lie on a
specified shape then they ane linked
fdge [inking» binany tmage detexmine
gradient of
* To. obtain binany rage delesmine, thexs
Qaodient of image
* specify, sub dwision tn the §-6 Plane
® Detfearnine the Counts of the acculurmotons
Pixels connectedions.
* Determine the velalionship method
chosed.
~ Suppose that , fry «
swe
”’ ponls +5 an
find subsets of these points .
line
7 ONE apassible 2 Sln fist deteym:
ne
of Points — that axé chse to
Pasticulasily,
Problem with this procedune
iS then . ip
bnik
thers hold and
hold anc
calls x high
Considey global
image , we want to
thot lie on . straight
al( subsets
lines - the
involves
4) ruls3finding: ne ym fines and then pevformning, ony
Grn-V 2) rw? Compaising, - of cvesy Point of bres.
This appacach 18 Computational pyohibidive ‘yn all by!
the Most lyjval applications .
Hough pxopred on altenative appsoach , commonly
yeffexcd fo as Hough txansfoam. ;
Gnsidey a point G:y:7 and the gereval en of a
7 staaight ive the slope - itercert fworm Y: sax +b for
. vatying, values of a and ‘b’ ynfinety lines Pass
thaough (oy) but they all satisfies Year -+b fox
diffexent ‘a ard 'b’ values
y
‘ a a)
A d
ay NN os)
\
N\
“contameley space (ob plre?
xy Plane
+ However, writing this ein as be-%Gat¥; ard covvesP-
onding the ab plane yields the eqn of a single [ine
for a fixed fair C94)
= ontt-& , (5153“
has a line in fasameter
¥ A Second poink Oxy -%) also
Sand this ling interscets
Space associated with ih
the line associated cwith (14,45) and (a! b'), wheac ‘a?
snteacept of the line
ond 41 43 the slope ard
xy plane
Gontaining » both Ge oYy) and Os 94:) in the
¥ Trfact » all pomls contained on this line have lines
tndessect at (a’,b) which
Mm parametex Space thal
axe shown m above figure.
* The comudational allsactiveness
asses fyorn Sub deviding- the poxametey Space
jnlo So-called “accumulator cell's ,ag given in below
figute » wheat (rox Gn) Grd Cbyrax ybmin) ate the
expected sanges of Shope and intercept values
of the Hough fxansfoxm,
«The cells at co-oadinates C3), estth accumulates value
A Cis) cossesponds
dren ee
i | Sub division of
I Porametey plane
je Ee ++] for use in the
le | Hough dyansfex
| el
Lae |
omy, ILS
e|
| ¢ Inilially these cells are set do zexo.
# Then» for VERY oink Cn Ye) in. the image plane, we
h metey tq?
kt the pavameley ‘ equal each of the allowed sub
division values on the a-axis and salve for the
Covyesponcling ‘y using, the eqn bs -Xqa4 Yee she
vesulling b's axe then rounded off to the veavest
allowed value tn dhe b-aus.
# Ta choice of « , A eb
‘ap'. yegulls in solution by , we FC
A (p9) = Ala) 41
¥ AE the end of this’ procedeote a value of ‘a? in Alii)
| Cossespords
"a" pols in dhe ayeplane [ying on the bine
Yrax +bi-
# Note that » sub dividing, the an a-axis into ¢k’ incacm
énls give S$. foy every pomt Cx 4k) ok values of
‘4! G@xyespording, fo the k- possible values of fq’.
¥€ with 'y’ sage poinls this Method involves mk
3 | Computations
| A problari with using» the e@'n Y=axtb to
yepyesent a tine 15 that , the slope -appacaches
infinity as the line approaches » the vertical one
way around this difficulty 1s Jo use the vesmal
yepresentation of a line.
onit-4, les+ |
IN ‘ |
0 \
Yy
J. woxmat |
“ representation
[ of a line
¥
# This cnslaucting, a fable is Sams 08 fox slope - intcacept
representation. ; He
% Instead of straight fines , however the locci we
| gmusoidal cunves in the 36 Plone.
* Incrementirg, "> and solvingy for the coxsesponding,
'p’ gives '@? entiaes in aceurulator A(ns) associated
with cell detexmined bi (5;.64)-
the above figute shows the subdivision of Pasametey
Sface. hese , the yange of angle 'e? 5 $40, weasuaed
W-a-to y-axis . =
thus fromm Figcay ja horigertal- ne has @=0°, wilh
‘g) beiengr egual 49 tve ‘X-intexcept..
“# lly, a vestical line has 6-90» with ¢s being egual
| fo the tve y-intercert 09 @=-qe° with '4! fe
| egal to the -ve y-imtexcepe .
i Ralthough , the focus So far hos been on staaighh kines,
| the Hough transform is applicable
ing
to any, function of
oNnit-q) teesfe forra give) =e, whee fv! 16 a weeloa" of Go-ordlinales
and '4' 39 a veckor of @ efficients.
0-4 (Yay = a” 30)
Fox’ example , the pomls lying or the civcler Can
he dlelected by using, the above app3aach
x The basic difference is the process pxcsence of 4,2
ma 30 pavametey Space with
ceurnutators of the form ACW
Solve
the °
and ¢ which vesulls
cube tke Cells and a
il the proceduse 15 fo gmexement cy
for c what Uhat salisfies e9’n ¢2) and
accurnulator Covyesporingy to the cell
[he tviplet (e162 1)
she Complexity” of the Hough tyan
on the no-of Co-oxdinates
and ¢a>
update
associated otth
sforrm 16 Sdzonqly
“dependent - and ¢o-efficients
im a given
Hexe 1 the €dge linking, 18 based on sepsesenting
15 in the form of o graph and Scaaching.
that coxyesPorid Be
functional zepaesentation.
edge seqment
© Lhe qzaph fox low cost paths
significant edges -
# This yepresertation pexforms well in the Pacsence of
noise -
nit = | tals 315 Gnsidexably more Complicated
This procedure
than the other
more processing lime
and veguircs
methods
pefine on edge clement as the boundary bho two
bhok “Pp! and tg) ate 4 -nicighbeurs
pixels tp’ and '9! such
as figuné here shows
#kdge clermends axe identified by the xy - co caclinakes
of pomls ‘Pp’ ard 9) te, m dhis figuae » Lhe edge
clement 43 defined by dhe Paivs Crp. 4p) Cxg,¥g)
3x3 ‘frnage Shown below
Consider the
# the ouley members one pixel co-ovdinales and tae
numbeas tn baackels yepyesent qyay-level value.
* bach edge element , define d by pixels ‘P' anal tg!
has ah associated cst ,defined as
cCp9g) = H- [tcp) - 99]
where ,
H-> Highest gaay-level value in the image
FP) % FQ) 5 Gaay level values of © p? and te!
vespectively
wall: | | 90/53¥ By? e@nvention tha Ponk tpt ay on the RRS af the
direction of travel abong. edge elernents-
pe qhe edge Seqment tay (aa) 46 between {he poinks
(hay ane (229 tm the above fig Cb)
ers we Pavelling, to the lef bios the $a
hen 'P2 49 Chay ancl q 48 (22). Tr Fhis Cose cost 8
'g) as shown abeve the edge Segment in fig tb)
ime [oo poinks,
We assume that , the adges start in the top
sy vow and terminate tn the last vou , 50 that the ast
clement of an edge can be only» plo points (1) 02)
oo (12) 9 Ch3)- |
le Wh , the last edge element has to be blo the points
(3,)) G2) (ort) (3,20 1 3)3)
¥,* p) and 9g? should be u-neighbouss only.
the
below figate shows the qxaph fox fhis Psoblam.
= a
2
a
a D (12) 3 3)
aoc
a a 6
—
feo f a ze a) (12) pees} _B. -- [ora] ry)
aS @
a Na
ioe =
{ Fy Lol eae
[ene] 3 (2) F229 |
onit-y, 253#* Heac y cach rede covacsponds to an edge element
from above figuste
AN are crisls bis two nectes if the Loo coaxespording,
taken in succession Can be past af an
edge elements
Cdge
* Goal yaces ané Shown shaded. :
* the Min. cst Path ts shocon dashed ,and the edge
fo this path is shawn above in fiqes
Gyvesponds
Types of Image seqmentation appsoaches’-
ET Ra ae tO TN o-
1) pixel based appyoach:-
H 45 one of the simplest approach fox Seqmentation,
only, gray values of individual pivels ate used.
fi) Region oserted Based Appyoach’-
io eee Pe epee
8% quouping- the neighbowting, pirels of Similan
iolensily, tevels , an image 1s portitionod ina a@nnectod
aca. weve , the qvay-Values ane avalyaed in larger aacas
Wi) ie - based opproach:
fdge detection 15 the appscach used Host facquenlly
fox segmenting, tages based on absupl changes tn
indensity - A ‘bias’ m dhe side of scqmented obiect can
be avoided without using a Complex Afxeshaldings sheme.
baik-q, dafss=)
4) thaesholdingy Technique
based ov)
method of
segmentation which is properly tov) populaaly? used,
postant
ane ynade.
Hee . the decissio
pixel formation thacshalding » 15 a havi
espe ciallys tre applications where speed 49 an Hm
factor
5) Moy phological appacach .~
H is also called os “waleyshed segmentation Tht»
approach = Gombines several tye allstbules of segmentation
Thaesholdeing :-
weet
suppose that the gray level hislogyarn shown i
figca) Covvesponds te an trrage $004) Composed af light
obiecls a1 a dayk background . im such a way that ebicet
and background fixels have gray levels qouped, jnto
Jaa dominant medes
—
|
| lh. all, l,l alll
nie G pasls ,| “Global Thaesheldirg: - *
[te simplest of all thyeshokling techniques is to pasts
| ion the image hislogsam by using» a Single global
| [haeshold ‘rv’.
the segmentation 15 then accomplished by- Scanning the |
| image, pixel by pivel and labeling cach pixel as
object ox back gyound, depercting, on whether gyay- le
of that pixel is greater ov less than the value of 'r
the success of this method depends entixely on
hoa well Lhe fistoqyam Can be paatitioncd- | en
The following algoasthr Can be used to oblain 7 |
|
|
|
|
|
autornatically -
- Select an initial estimate fox ‘7’.
2. Seqment the image using ‘r'. this will Paoduce
two qxoups of prrels.
Gi > Gnsisting, of all pixels with gaay-level values > 7 |
“ond G2 > Gnsisting of all pivels with values <#
3. Compute the avesage guay-level values su, and HM,
fox the pixels in yeqions Gy and Ge
4. @mpute a new thaeshold value
= kta |
5 Repeat step 2 through 4 untill the diffexence in |
Successive ;levations is Smaller than fhe pycelefined |
Paxametey to |
wey
ont, els- . 4
i pasamelex ‘t,' +5 used fo cantool fhe vo- of
ilexations in Situations whese speed 45 a7 smpowtant
issue:
sve. thxesholding:-
ppaplive [heesteddieg:
Tmaging, factors such as uneven sMturmination
hisfogvar that
single qbbal
, ada pkive thyesh-
gn faansform a perfectly seqmentable
gan not be — paxtitioned effectivly by o
thaeshold- To handle lypes of stluations
olding 18 used -
kone obvious wa
und 15 fo Select a thyeshold ‘7!
y to extzoct the ebiects from the
) that serazates
back 9x0
[hese Modes
then any point plow for which $004) 77 19 called an
‘obieck_ goin!’ otherwise the poml % called“ backqyound
wl Se
modes chavactesiac the image
* Tn fig (7,3 dominant
higlogaar
# Herve, Mallilevel
belonging to one
object fass fh foO4)uTe
thresholding, classifies @ point (19) 05
object class if Tr 2(uy) £72, to the
and 4o the backq ound
other
fh fowetr
Tn general, seqmmentation pyoblams yequiaing~
Multiple fhesholds we best solved using vegion g vowing
Nethods
onit-4 85/532%
* the hvesholding- may be viewed @S an operation |
Ilad invelvs fests against a function ‘7’ of the form
|
T= Tloy, poow), Foy y |
where, fog) > Gray level of point Oo¥) |
PCx,yJ—> Some local Pxopeaty of this point Guy)
Ex!- Average quay level of a neighbowt hood Centered
on CY)
A thyeshod image gtey) is defined as
=
96,4) = tf fy 2T
of fewer — @.
* when “> ‘depends *only on f(xy) . the thyeshold 45
galled qlebal — thyesholding .
*H "Ty depends on both $004) and per, the Ubeshebtiny
is called ‘ focal thaeshalding’.
#0 7 deperds on the Spatial Co-oadinates ‘x’ and ty?
the fhxeshold is called
‘ om
“dynamic? cox) adaplive thyeshaldin
7 f
tort Uy) 26/53| tn Uhis approach, the Chacsh
| ’ hreshold value fox cach Firel
|depercls Upon the locations of Pixels im sub -irnases
Lx we have fo ‘devide the oviginal ‘image inte cabs
ame then lilac a different fhveshold 40 segrnent
cach sub -image
all the sub-smages thal did not Contain a boundary
blo obieck Containing, boundaaies hod variance’ in
excess of loo
; Fach Sub-image with variance gyeatey than [oo #49
| Segmented with a fhyeshold computed fox that gub-irrage
using, the atove algorithm
¥ The snifial value of ‘+’ each cose ‘was selected 95
Lhe point mid way bes the Hin and Max. qvay levels
in the Sub- image
Rall ub -wnages wilh variance less than [000 were
fycated a5 one Composite image » hich was Seqmented |
using, a single ~ Lhyeshold estimated using the same |
algcocithon: |
Adaptive thyesholding, 19 impostant in text image!
flocs detection and object feadwre |
|
| binasetgation- |
binaaigation » glass
onit-& als[cplimal global and ‘adaptive thacsholding:- “
|
| this methed establishes Ibyesholds that pycduce |
| the Min avexage segmentation éxx0¥ |
Thal an tmage contains only wo Pyinespal |
| qvay yegions - Let ‘2’ denole qray- level values these woh}
| may be xandom w quantities ard theiy histogiam may
be Gonsidesed an estimate of bheiy PDF » Plz) |
Suppose
this overall densily function 48 the Sum ox
mintuxe of two dengilies one for the light and the =
othey fox the dask yegtons in the image
Lhe densities is known oF assumed , |
Deleymine an oplimal thyeshold for seqmenting Ue |
mage in to the fuo distinct egions. |
vo) i
| «it lhe form of
ih 39 Possible to
nye alt
9 i a ||
|
a/ eee Ve | pack gzound « |
x this figere shows two ofp's
) Coxsesponds to gray levels of object
the backgsound levels.
ASSUME 5 Pye
jn an image & Pelz) yepyesents
unit) asissthe Ni
jaduse pay describing» the overall qray-level
ywualion wn dhe image is
PZ) = Py RIZ) + PaPal2y—>y)
where, an
- P,~> probability, wilh yalue 2) 43 an obiect piel
fa > probability that pixel is background Rexel
Given pixel belongs to esther obigct ov backgxound , then
P+ Pa zl —5&)
AM page 76 Seqmented by classifyny 45 ackgyound
all pixels with quay-levels gyeater than a Unveshelel
'z'. All ofhex pyxels axe called obiect pixels
our Main absective is to select the value -t1’ that
minimises the average evsoy in making the decisions
fhat a qiven pixel belongs fo an obiect con to the
backgyound-
thus , the psobabikty of eysonccusly classifying
a backgxound point as an object point is,
a Jt
E,(1) = { Pylzid2 3G)
©
his t6 the avea under the cuave of “Patz? to
the left of the thaeshold
Similonly, the psobability- of exvoncously Classifying,
an obsect pot as backgyound 15,
co
By (D= { p(ad2 WW)
+
onit- 4, 2als3»
which is the atea undley The curve of Pitz) bo
the sight of ty! then the overall probabilily of exor
19
ECT) = Pa E\lT) + PEQ(D 25)
* note » how fhe quanlilies £, and E2 ave weighted
by the probability of ‘occusance of obseck (ox)
backgxounc pixels . Hexe subscripis axe also opposites.
To find the “ Ihyeshold value fox which this caor
48 Minimal
Pi ACD = Pert) 6
find the optimum
th
qhis egh 19 solved for ‘1’ to
Lhseshold. woke Phot +46 fr=pe » then the optimum thyeshed
+5 whee the curves for Pitz? & Plz) inteasect.
A eA ao 7 (2-2) age
Pe) - —
lainey + Saree >t)
using, thas egin, the ‘geneval sol’n Of cfr G) results oH
in the followings soln fox the thveshold T.
AT’; BT4¢ 20 6s)
whee ,
= at
A= 6*- 6?
Be Q (ne*-ug6))
C= atu
Suey - yah VEPey In COP CesPed
onit-4 36aA quadaalic egy |
"
has lux possible sal’ny , Lao
Jhoeshold values mayb
re ’
solulion- yegutaed Lo oblain the aptima)
sf fhe vavian
ces ay
ave equal, 6 6 = ,? et
=e? ,a Single lhsesheld
ss Sufficient:
pe Bu >
eae ep
Tat 5 200)
uf Pi=P2 >
: 1 = Pa Lhe optimal {hueshold 1s the 9v9 af
: the means
©” © 29
Determining the optimal Ihveshold may be May
accomplished for other densities of known fos , such as
| Rayleigh and tog -noxmal densities
Ex.- the Mean squaxe
2
PB [pees -h(2s)J 30
2
exsoy bl» the mirbuye density
+t
ems = %
>
histoqvam “6 assumed
ing the complete
where an n- Point
pal yeason for cotimat
the pairs
density” qs to deteamine Ihe presence (92) absence
dominant sabes i" the POF.optimum Global Thaesholding, using» olsu's Method.
RRA RAR RRA
Thyesholding- ray be viewed 95 a statistical
decision theory, paoblen whose objective 15 ba Minirnige
signing. prrcls to tuo o”
the avy exxay jncusved im a8
ts known to have
move gyoups on classes his problem
an elegant closed fovm Sol’n known a5 the Bays
decision ule . this approach 38 given above
the alfesnalive appyoach fox opbrnurm global . thre.
sholding, 38 olsu's Nelhed . the Method 1 OPkimurn tn the
Senge Ibat i maximizes the bls - class vaniance uscd
m statistical diccsimmal onalysis
Tl 15 based enkively on computations perfosmed
on the histogyam of an image , an casily, oblainable
4-D annay
the algoxithm foy obgu's method 15 a5 follocs
*Gompule the noxmaliaed histogram of the i/p image
Denote the Components of the histogram by p,, j-o19--t-1 ox
* ;
Corpede the cumulative sums, pick), Fox koh... b
using the ¢€ &N Pick) = £p.
ize!
eG ;
ompute the cumulative sums, mt) , doy keooit . we ouncleny |
lo be satisfied amd 2m ]
Hi) the Section of Seed points Cte to ZL tegion Pa
suppose, the Cals
P ne Smooth segions snag posing? acornehrY |
| wage Gorse’
fo the planay suxfaces of the See al ahieats
| Adtorcingy , one may, assume thal the vasiance tn |
| gang level of pitels within a yegion should be Srnall «This |
leads to 0 pasticulaay- pxopeaty oy moxe specifically” |
“homogeneity, paopearlies fo be sakisficd bi Lhe 4ray-levels |
of pixels _ tying. within a zegion
|
|
|
lel us denote this pyopeyty, by prop ¢R) whese |
3 Prop (R) = oe fecer -af eth oo |
| PO Geader) dialer . |
where» Cord (R) 18 the v0-oF pixels in the aeqion ‘r? |
ard *q’ is the vneans of qoay-level of prrels lying in
that yegion: iC»
~ E9000)
9 * Gard(a) H,0€R
and th > pyedefined thyeshold
ont gy, 38/53OO
le le any ¥eqions would came |
ep Th Uh’ is haages mony gegions would mmeige toa
single 9egion another problem of [hig Heasuwe of homoge.
x4 more poscls
neilyr is a5 the 39 se, moxe an
jcluded i” Ihe yeqion , the pixels that fave 9xay -
tons ave accepted because of
£ Yh! be very small, many ti
von grows
aye
| eves with higher vavial
overaging «
To avoid this problem >
yarige of qvay - levels of pixels lying,
=
we fake the homogeneity.
pyopealy for a Small
d define the Property 5»
Rop (Ry; max $9) J- min S gcc) fe th
i moer i J met i
ma xegion ani
Assigning, one pie! at a time as membex of
| the cuxvent vegion 15 Lhe simplest appyoach to region
15 one of the Slowest approach as «ell.
| quowing, . This
aly is to Gnsidey
pn bellex appsoach on the prope
anstead of Single Pixel =
yegion al a time
be salistied , this yeqion.
a 5rmall
| Dependingr on the propesty to
Move robust 40 noise than the Pixel-
| basecl appsoach 8
basecl appyoach
EX
| Consider the tmage shown heve.
nk Gy 24/.
2
G
lw&
|
|
tT
T
foy seed pomt 9, sls region wg Ri |
Jereesen Sr Se Negea
Gab divide an image initially nko a set of
cnbitaay sdisiointed aegions and then Merge ard [or |
sph lhe wegions to Salisty 10 conditions - |
Region sphilling :- \
MA ae
let ‘R' yepaesent the entive image segion and select
a predicode P. i
one approach ox segmenting, R is to subdevide it 1
successively into Smalley and smallax guadsant eqions $0 |
That, for anys vegion Ri, PCR) = THE. we stast with enbiae |
yegqion - |
Ti ptr = false, we divide the tmage into quadants.
Tf tp! 4s false for any guadsand » we subdqvide ed ail
yon! info subgacdsands , and $ 00° This paaticulos splitting)
fechrigue has a Convenient yepaesentation in the foro of
a 50 - celled guadkaee - a5 qiven belowTee ts
fo a Subdivision I, [
[ex cine
yoot of the bree
and that ¢ach nade Corvesponds
was Gubdivided fusthex
| this Gase’ Ry
|| @ partitioned image
b) Coxscspordiny quadtace |
=
Region Méaqing*-
PAA nna
tf only, splitting were used 5 the
would contain adjacend regions with identical pacpes,
yemedied by allowing” Messing,
final postition
likely-
lies. This daaw back may be
aS well as splitting
Two adjacent vegions Ry and R_ ae Merged only # |
i P(R;URK) = Tauc
i
this 15 sumraviaed by the following procedures 7 (hn,
|
| which jak any Step we
¥# split into 4 adisiomt quadsants any Region Ry dou
which p(R.) = false
* Meage any, adjacent segions Rg and Ry foxy which Poy
= True
| |
# Stop when no further Mesqing toy) splitlingy 15 Possible |
Tk ® Customany fo specify a min guad yegion
2
| Sige beyond which ne fuathey splitkings 15 Coded cut. |
I
MER YY S83Region Meaging,
15 exactly opposite bo the vogion
splitlinge Methect. this
Methed is a bottom -up methed hile
vegion splilling ig top -bollom —sacthed
¥* bi i 4
like segion spklbing, this wethod also 1s arpticable te
images whose no-of yows and no-of Columns arte same
integex poweyx of Q
we check if
4 adjacent bemogenecus wegiond aaange!
ina axa fashion fogethey saliffies dhe homogeneity prperty
TH yes »we merge those aegions fo a single homogencous
yeqion, otheawise the yeqions ane left as they ae
Ext- Consider an $X3 4mage
14 6 €
55 | 43
Sra te,
2 3 | 4 ¢
a2 | 4?
2 2 | 5 6
fe 3 | 4
23 56
|
f
# The vegions cy reas Gi 1 Ca axe merged R, because they
Satisfy the homogeneity property.
Regions Gy Crys Car 2 Coy ~~~ eke ate kept apast -
hecause they, individually Satisty, the psopeaty « but
vet as a@ a@mbination
anit 4 53/34, ; UNIT -W. PART ot
OCESSTNGr ]
ROREHLORTEAL Hage pROcEssENe
tion:
| The woud Moxphology commonly, clenotes a bsanch of
biolegy, Hak deals with the fowm and sbyuctuye of animals |
and plants. we use the Same word hese in the contexd of |
Mathermatical Moxphology 45 a tool fox ertaacting. image Cornpen,
tris that axe usetul tn dhe vepwesentation and descxiplion of|
region shape, such as boundaxies , skeltons vand the Conve y
bull. we oe intevested algo in Moxphelogical techniques foy
Px - on post Processing, , Such as Moxphologica| Fillering . dhin-
"ing, and Pruning .
| Exosion and Dilation :-
rare nee ADI
Feosion:-
wet
with A and Boas sels im 22 | the exosion of A and by!
8, denoted nog , js defined as, |
498 = f2/(n2cA} —say
Th words , this €9'n indicates thak fhe ezoston of
A by B is the set of all points z Such that B, translated
by 2, is Gntained in A-TIn the following. discussion, sel
Bis assumed fo be a Skruckwing, Glemend . £9! a) 4s
eon
|
the Mathmatical formation of the example +n Fig @. |
Because the statement that g has to be Contained ina)
1S equivalent fo 6 not Sharing, a Common elernents |
with Lhe backqyound ewe Can expyess
erosion im theplowing’ equivalent — foyr,
ASB =
= J2/0B),nae - ¢} 02)
hese. aS Ae
‘ Ao is the Cornplernent of A and gis the
empl sed
7c follows ‘
the following fiqutes shows of exosion . the clement: of
AwB or Shown shaded and the backgsound is while. the
Solid boundary in figced 4s the lirik beyond ghich fuxther
displacements of the sign of B would couse the 5b vuchuring,
an A Thus, the
|
Gse being, completly, contained
points within this boundany 1 Gonstitubes the
1 Cxosion shaxed in figeo |
of z that satisty
. dashed tn.
3, clement to
locus of
erosion of A by B. we show th
«
exosion 13 Simply the set of values
egn ) &@ + The boundany- of set A is shown
fq. © and fig) only as a ste yefesence vik ts not pal
of the €xosion operation . Fig Gd.
(e) shows the ¢x0sion of A by
gct was extoded
) shows an elongated
bfyuctwany clement , and fig
a
this element - ar note that the oaiginal
fo a line.
| d
CUD |
| | ol dry 1
da)
| 6
{ 7 |
oo ;
oe 3d/q d/e \
|
. ; —||
e Vp dy We
Figuae + (aj set A
(b) Square staucttoing clement B
i
(e) Exosion of A by B», Shown shaded
|
(A) Elongated Stsuctuaing, element
(€) Exosion of A by 8 usiny this element
with a and B as Selo in 2% , the dilation of A by
|
B, denoted ADB , 15 defined a
: 4
| A@8 = 2 /8),na dd $30
| |
this egn is based on xeflectingry B about its oigin, |
o
I ard shifting, this seflection by z. the dilation of Aly B |
| then ts the sek of all displacements 12 1 Such that B ond
| A ovevlp by af least one clement . Based on this |
inteypaclation » ¢gn t) Gn be wrillen eguivalently as,
A@B = $2 /f@),na} ca pa)
As before , we assume that B is a ste%ucting>
‘nl 43 the set to be dilated.
i
| element — and
Ul 7
nie yy qe)sa: UZ
Fans © and (2) axe nok the only, definilions of
aietion curvenllys tn use, Houcver , the paccedingy dent
pons have a distinct advantage aver othea formulations
wn that they are moze inluttive when the struck”
clement 8 15 Viewed a5 a Convolution mask « the baste
pyocess of Shipping @ about sls oyigin ond then successi-
vely displacing, tk sq that sl shes ; - on)
Ides over set (mage) A
4 analogous 6 Spatial convolution . However , the dilation
13 based on Set operations and thescloxe 19 9 von-hneay
opeaction, Whereas Convolution 1s a linear opcaation
Unlike cxosion , which 15 a Shainking Cox) Lhinningy
opevation dilation “'gyows” fox) " Unichness ” objects 1” 0
binastyy image: the specie manney and extent of this
thickening 15 Controlled by the shape of the structusiny
clement used - figcar shows the Same set used in cxosion
fiqutes and figlb) shows a Sructwdingy element « the
dashed tine in $iqc@) shows the oviginal seb for velewcnee,|
and the solid tine shows the Twit beyond which any |
fusther displacements of Ihe origin of B by 2 would
cause the intersection of A ord A do be emply -rheackac,
all poinds on and inside {his boundony, constitute the
dilation of A by B. Fiy Cd) Shows a styuctuting clement
designed 40 achieve move dilation vestically than
hoxigentally, sand figtc) Shows the dilation achieved
taith lbs element| | ; tly | \
I dq | |
| : be | |
| a lave
| ala Ve 4 Np |
f | | 7 ima |
I lela r dig ||
of? : |
| | ‘ 4d |)
|_| =
jo Bs bee. |
| “|
dg dag |
| FIP * fa) sek a : ,
| (b) Squaxe stauctuaing, element . ~ \\
(0) dilation of A by B »shoum Shaded |
(d) Elongated stauctusing, element
(e7 Dilation of A si this element. the dotted sia
im G) & (er 4s the boundary, of Set Ar Shown |
only, foy vefesence.
OM Geaombininge Dilali
Combine Dilation ® Lyosiont-
opening? and closing :-
wee a
pilalion expands the components of an frmage and
exosion Shainks hem Tn this section we disc {wo
alhex impoxtant morphological opevations : aperingy and
closing Opening, genezallys smoothes the cota of an
thin
obsect , bycaks vaxow islhmuses , and ekiminales
protrusions - closing, also tends fo smooth of contours
bat , 08 opposed fo opering, f generally fuses MAvHOW
byeaks and long, thin galls , elerminates srrall holes.
and fills gaps in the contous
the opening, of Set A by styuckuaing- ©
denoted AoB 15 defined as,
lement 8,
A 08 = (A@B)@B
Thus, the openings A by B i the caosion of A by
B , followed . by a dilation of the vesalt by B.
gimilayly the closing of set A by glyuctusing
element B ,denottd A+B 115 defined as, °
AeB = (A® BICB
which says that Lhe closing, of A by 8 is simply,
the dilation of A by B- followed by the crasion of
the vesulé by B-
ont “A Us/s346
the opening opewalion has a Simple qcormelaic
mleyprclation » sappose thal the sévuctusing,
element B as a (flat) 6
the boundary of a AoB 1 then
in B that seach the farlhes¢
1g volled avourd the inside
we vicar
“yollingy ball".
established by the poinl
indo the boundary of A 4% 8
of [his » boundany - this qeormebaic
the openings opexation leads #0 4
which stotes that lhe opening, of
slates of B that fit
expyessed 05 filling,
filling, Property of
get theoretic forrnulalion,
A by 8 15 ablained by
faking. the union of all byan inl) &
A. that 48 opening, Can be
- pyocess Such that
AoB = VS) Ite), cA $
whese Ufe} denotes the union of all the sets
inside the byaces-
closmg has a sim inteypzetation,
lay qeometsic
except that now we wll B on the outside of the e
boundoay, + As shown below » opening, and closing, ane
dual of each other » $0 having fo soll the tall
on the outside is not unexpected - Gieomatyically , a Point
w 16 an élemenk of A+B if and only if
(B), NA +g for any translate of (B)z that contains w
Figuae Q sllusteates the basic geometuical paoperties of
closing .
ONE, 6/53(oa |
now OF
Frgane aM:
(a) 5tauctarey
wUND. element Bou .
boundary» of 4 rolling” alongs the ‘nme
a (b) Shuctuaing, element
ment
(c) the heav:
Ye line 5
ea ne is the outer boundary of the
(cd) Complete
opening, we did not shade A in (a) for
Clasdty.
Pv a
Fig. @ @) Sbyactuwingy clement (8? “yolling "on dhe outer |
boundayy of sel A
(b) the heavy line 18 the outer boundaxy
closing -
(6) Complete
for co clarity:
of the |
closing’. we did vot shade A in (a)
unit by yals3ug
Hil COR) Miss. Tans form’
the hit -@y) -miss dvansfoam 18 a general binoyy.
Noxpholegical operation That can be used {0 look for
Payticulay palleyns of foxegyound and background pirel,
in an tmage «Il is actually, the basic apexation of binaay
Mayphology* since almost all Lhe other binary Moxphologin|
operaddys Can be desived formit: The sample Sbructuying,
Masks &Sed are shown ‘n below figure.
|
the algosithrs for the hit -ox- Miss laansfoxm ‘is
those of the othey Moxphalogical opezatoys
Similax to
1 a3 follows.
| ¥ Panslate the center of the stsuckuring, element to | ox
all the pomts of the input smage. |
% Compare the styuckweng, element with the tmage |
pixels
* Tf Ueve if a Complele match’ , then
Ue piel underneath the sfauckuaingr element |
ts sed to the forgyound coloux- this opevation is
called a hid -
nit) egg