EDGE DETECTION USING EVOLUTIONARY ALGORITHMS A Project Report submitted in partial fulllment of the requirement For the award of degree of BACHE!R !F "ECH#!!$% F!R'A"&!# "ECH#!!$% (ubmitted B) (ii) ABSTRACT Edge detection identifies points in a digital image where the image brightness changes sharply or has discontinuities with the help of mathematical methods. Vision systems and object recognition systems require edge detection. There are a lot of edge detection operato rs such as the gradient operator and the Laplacian operator that are based on the assumption that edges in various images are step intensity edges. Due to this, thic and fragmented edges are detected. !t is still a difficult tas to find true edges in an image. The quality of edge detection depends on a lot of factors such as illumination, density of edges in the scene and noise. "uge search space is another problem with most of the e#isting operators. The tas for edge detection is time consuming and memory e#hausting if done without optimi$ation. To avoid this, various evolutionary algorithms are increasingly sought for edge detection such as bacterial foraging, particle swarm optimi$ation and differential search algorithms. These algorithms don%t require any preprocessing and hence are much more efficient than the previous methods for edge detection.
(iii) CONTENTS
&ertificate i. ii. 'cnowledgement 'bstract iii. List iv. figures of
i ii iii v
CHAPTERS
PAGE
1. Introduction
()
2. Literature
(*
+.) Digital !mages +.).) Types oise +.+
( * *( - (
+.+.)Types +.* !mage rocessing +.0 Edge Detection
-( ( / ( 1
+.0.) 'pproaches
( )2
+.0.).) Edge detection using gradient
( )2
+.0.).+ Edge detection using second derivative
( )*
+.0.).*'nt&olony 3ptimi$ation
()-
+.0.).0 article 4warm 3ptimi$ation
( )/
3. Proo!ed "et#odo$o%&
( )5
'. Re!u$t!
( **
. Conc$u!ion
( *6
. Bi*$io%ra#&
( 02 (i+) LIST O, ,IG-RES
+.) 7lac and white image +.+ 8rayscale !mage +.* 987 !mage +.0 !ntensity edges:;a< 4tep:Edges ;b< 9amp:edges ;c< 9oof:edges +.- Direction of 8radient
*.) ' local configuration at the pi#el position !i,j for computing the variation Vc;!i,j< *.+ ermissible range for ant%s movement:;a< 0:connectivity ;b< 5 connectivity *.* Eight ways of moving from one pi#el to its neighborhood pi#el
0.) Test !mage= &ameraman 0.+ 9esults obtained by incorporating equation *.0a , *.0b, *.0c, *.0d 0.* Test !mage= Lena
0.0 9esults obtained by incorporating equation *.0a, *.0b, *.0c, *.0d 0.- Test !mage= Lena 0./ 9esult of applying 43 based approach 0.1 Test !mage= &ameraman 0.5 9esult of applying 43 based approach 0.6 Test !mage= Lena 0.)2 9esult of applying proposed optimi$ed '&3 0.)) Test !mage= &ameraman 0.)+ 9esult of applying proposed optimi$ed '&3
(+)
&hapter ) INTRO-CTION Edge detection is an important problem in image processing. Edge detection is a fundamental technique for compressing the data content in the images to simplify the high:level image processing tass, as edges contain significant information about the image and edges can help to segregate the shape of the objects. !n an image, the edge gives the boundary between two regions that is determined by sharp discontinuity in the intensity values. Edges can be determined in the spatial domain by direct manipulations of image pi#els or by transforming it to another domain ;frequency domain<.. To determine the edges% pi#el, it is necessary to detect the position between two pi#els. The resultant image after performing edge detection is merely the outline of the input image from which various important features lie corners, lines, and curves can be e#tracted.
' lot of research has been done in the area of image segmentation using edge detection. The given image is separated into object and bacground, by detecting an edge between them.
>ost of the edge detection techniques involve computation of a local first or second order derivative operator, following which steps are taen in order to minimi$e the effects of noise. The literature comprises of many edge detection techniques lie 4obel, rewitt and 9oberts who proposed some of the earliest operators to detect edges in an image. The methods used by these operators are gradient methods that are used to detect edges in a particular direction. oise is the major factor that inhibits these edge detection procedures. This problem was then overcame by &anny which convolved the image with the derivatives of first order of 8aussian filter for smoothening in the direction of local gradient followed by edge detection using thresholding.
Ant colony optimization ;'&3< is an algorithm inspired by nature that is based on the natural behavior of ant species. The ants while searching for food deposit pheromone on the ground. '&3 is used to deal with the edge detection problem in the images. ?sing this approach a pheromone matri# is established based on the movement of a group of ants travelling on the image. This matri# gives the information about the edges presented at each pi#el location of the image. >oreover, the ant%s movement is characteri$ed by the local variation of the pi#el intensity *
values. The algorithm based on 43 uses an optimi$ation method for detecting edges in images corrupted with noise. The constraints are handled using a preservation method. The 43 based algorithm effectively ma#imi$es the interest distance ;that is distances between pi#el values in the two regions separated by a continuous edge< and minimi$es the intra:set distance ;that is the distance between the pi#el intensities within each region<. !t accurately detects thin, continuous and smooth edges in comple# images. ' single initiali$ation of the algorithm is sufficient for all the runs maing the algorithm faster. @or representing these curves in this search space, an encoding scheme is used. @or the evaluation of each curve, a fitness function is used to measure how similar are the pi#els within each sub:region and how different are they between two sub: regions
This project wor is based on A)B, A)5B. Ce have implemented the earlier said wor and tried to improve the same using some modifications.
+
&hapter + LITERAT-RE
i%ita$ I"a%e!
Digital images are representation of +:dimensional images as set of pi#el:intensity values. Digiti$ation states that an image is an appro#imation of a real scenario. !n a mathematical view, a monochromatic image is a +D function f;#, y< where # and y are spatial coordinates. The inten!it& or gray level of the image at any pair of coordinates;#, y< is the amplitude at that point.
There are three types of digital images based on the number bits required to store the intensity value for each pi#el position=
B$ac/ and 0#ite ;) bit per pi#el<= They can tae only + values:blac and white, or 2 or ) and are
the simplest type of images and thus only ) bit is required to represent every pi#el. >oreover, these images are usually used in applications. They are used where the information required is only gener al shape or outline. 8ray:scale images are conver ted to binary images using a threshold operation where all the pi#els above the threshold value are mared as white ;)< and those below are mared as blac ;2<.
,
+.)7lac and white image Gra&!ca$e ;5 bits per pi#el<=
8ray:scale images are classified as monochrom e ;one:color<
images. They provide gray level information and no information about color. The gray levels available are determined by the number of bits per pi#el. The typical gray:scale image contains 5:bitspi#el allowing +-/ gray:levels.
+.+ 8rayscale !mage
RGB ;+0 bits per pi#el<= &olor images are basically three band mono chromatic image data
where every band represents distinct colors. The gray:level information in each spectral band is the true information stored in the image. They are represented as 9ed, 8reen and 7lue i.e. 987 images. The color image has +0 bits per pi#el.
-
+.* 987 !mage Noi!e
Noi!e means any unwanted signal. oise in an image is random, that is, they are not present in
an image. They are variation of the brightness levels or the color information in images, and is usually an aspect of electronic noise. Digital images could be contaminated by noise during image acquisition and transmission. &orrupted images must be restored in order to e#tract useful information as they severely disrupt the subsequent image processing operations. Thus digital image processing is performed to restore the images for subsequent use.
!n most cases there are two types of noises that are added to images, namely, additi+e Gau!!ian noi!e and i"u$!e noi!e.
!n !mpulse noise, there are two types of impulse noise, )< @i#ed valued impulse noise;salt:and:pepper<. +< 9andom valued impulse noise. 8aussian noise affects all pi#els of the image. 4uch noise is used during image acquisition process. !ts probability density function is equal to normal distribution.
I"a%e eature!
+ types of features are there in an image. They are: .
@eatures that are 8lobal F these depict the global features of an image, including frequency domain descriptors, intensity histogram, high order statistics and covariance matri# etc.
@eatures that are Local F these depict the local regions with properties lie corners, edges, curves, lines, regions with special properties, etc.
Various features are useful, depending on the applications.
I"a%e roce!!in%
The technique that converts an image into digital form and performs all the operations on it is called I"a%e roce!!in%. !t is done in order to get an enhanced image and e#tract information that is useful to us from it. !n image processing, input is image, lie video frame or photograph. The output may be image or characteristics associated with that image. !t is a type of signal dispensation. ?sually I"a%e Proce!!in% system applies signal processing methods to them. The two major tas of image processing are= improvement of pictorial information to mae it viable for human interpretation and processing image data for transmission, storage and representation for autonomous machine perception.
Puro!e o I"a%e roce!!in%
The various purposes of image processing are divided into following groups. They are=
(1) i!ua$iin% i"a%e! F 3bserve the objects that are not visible. i!ua$iation is a method
for creating images, diagrams, or animations to send a message.
(2) S#arenin% o i"a%e! and it! re!torationF I"a%e !#arenin% is a very important tool
that emphasi$es te#ture and draws viewer%s focus to create a better image. Digital camera /
sensors and lenses always smoothens an image to some e#tent in which correction is required. The noise removal ;motion blur, sensor noise etc.< from images is called I"a%e Re!toration. Various types of filters such as median filters or low:pass filters are the
simplest of the possible approaches for noise removal. >ore sophisticated methods assume a method to differentiate them from noise.
(3) Retrie+a$ o i"a%e! 4 @ind the image of interest . @or searching, browsing and retrieving
images from a large database of digital images is called
i"a%e retrie+a$ system. >ost
common and traditional techniques of image retrieval utili$e various methods of adding captions, eywords, or image descriptors. !t is done so that retrieval can be performed over the annotation words.
(') Reco%nition o i"a%e!= !t used for identifying objects present in an image. The process
begins with methods lie noise removal, followed by basic level feature e#traction that helps in locating regions, lines and areas with various te#ture levels.
Ed%e etection
The mathematical method that identifies points in a digital image at which the image brightness has discontinuities or changes sharply is called Ed%e detection. The points of sharp change are terme d as ed%e!. Edge detection is an important tool used in the areas of
eature
e5traction and eature detection and is used widely in image processing, machine
vision and computer vision.
Edges can be classified as follows based on intensity levels.
Ste ed%e!= The intensity in the image changes drastically from one value to a different value at
the point of discontinuity. Ra" ed%e!= !t is a type of step edge. !n this type of edge, the change in intensity is not instantaneous. !nstead, it occurs over a certain distance.
0
Roo ed%e!6 !t is a type of ridge edge in which the change in intensity is not instantaneous.
!nstead, it occurs over a certain distance.
The edges from a +:D image of a *:D scene that are e#tracted are classified as either view:point dependent or view:point independe nt. 'n edge that depicts characteristic properties of the *:D objects lie surface shape and surface marings is called a
+ie0oint indeendent edge. 'n
edge which on changing the viewpoint gets changed, and depicts the geometry of the scene, such as occlusion of objects on one another is called a +ie0oint deendent edge.
+.0 !ntensity edges:;a< 4tep:Edges ;b< 9amp:edges ;c< 9oof:edges
e!ired c#aracteri!tic! o i"a%e!
Accurate $oca$iationF !t is often desired that an edge should lie in a region that is
spatially accurate, separating the different regions in the best way possible. !n many real images, the edge position may be ambiguous. This is the case when the same pair of dissimilar regions are separated by a collection of closely adjacent boundaries. The degree of dissimilarity between the regions on either sides of the boundary will vary for each boundary because each boundary in the collection has a unique spatial location. Chen the edge coincides with the boundary that results in the ma#imum degree of dissimilarity, then the edge is said to be accurately locali$ed.
T#inne!!:!t is often desired that edges ;also considered as boundaries< form thin lines in
an image. !deally, they should be only one pi#el wide in the direction that is perpendicular to the edge direction. 1
Continuit&FEdges must e#hibit a continuity which thus, reflects the nature of the
boundary. ?sually the physical boundaries are continuous in nature. 3nly the correct edges should e#hibit this property. "owever, there should be no constraint on edges that mae closed boundaries in an image.
Len%t#F'ppearance of short and scattered edges of one or two pi#els in length is caused
by noise and fine te#tures. Ce will not consider such short edges and eep our concept of edges to those that are minimum three pi#els long. The trade:off between the different desirable characteristics of an edge is always present. Due to conflicting edge requirements, there are many situations where it is not possible to simultaneously achieve two or more characteristics. @or instance, poor locali$ation and the appearance of false boundaries can be resulted as a consequence of requiring every edge to be long and continuous. "ence, associating a measure of importance with each desirable edge characteristic is appropriate so that situations that have conflicting edge requirements may be solved. !mportance of each characteristic is emphasi$ed by attaching a weight to its assoc iated cost factor which is seen in the formulation of the comparative cost function.
Para"eter! or oti"a$ detection o ed%e!
Oti"a$ detection= The edge detector must potentially reduce the chances of detecting
unwanted edges caused due to noise and also should not miss real images.
Oti"a$ $oca$iation6 The edges that are detected should be e#tremely close to the true edges.
Re!on!e Count= Ensure that a real edge does not result in more than one already detected edge. A$ication!
4ome of the applications of edge detectors are= a< 9obotics, computer vision and image processing applications= 2
&ontour feature e#traction. 3bject tracing and recognition.
b< !n the area of biometrics= @ace detection @ingerprint recognition !ris identification etc.
c< >achine vision gauging applications= !nspection for missing parts >easurement of dimensions of critical parts using gauging.
d< >edical !maging applications= G:9ay &T 4can
Aroac#e! or ed%e detection
There are various methods for edge detection, in which most of these methods can be grouped into two categories= ;)< Detection of local minima or ma#ima of the Hrst derivative (!earc#7*a!ed) ;+< Detection of the $ero:crossing of the second derivative ;ero7cro!!in% *a!ed).
The first class of methods that is the search:based methods can detect edges in an image by first evaluating an edge strength measure that is a first:order derivative e#pression lie gradient magnitude, and then loos for the direction where the magnitude of the gradient is ma#imum. The $ero:crossing based methods find $ero:crossings in a second:order derivative that has been calculated from the image for finding edges.
etectin% ed%e! u!in% t#e %radient tec#ni8ue
*3
The gradient is a vector quantity that has a magnitude and a direction. The gradient magnitude determines the strength of an edge wherea s the gradient direction is perpendicular to the direction of the edge.
;+.)<
+.- Direction of 8radient Various operators are available for the calculation of gradient. 4ome of them are as follows=
9obert%s edge detector
;+.+<
**
These following mass can be used for implementing the appro#imation=
;+.*<
rewitt edge detector
&onsider the arrangement of pi#els about the pi#el ;i, j<=
The partial derivatives can be computed by=
;+.0< 4etting c I ), we get the rewitt operator=
;+.-< 4obel edge detector
4etting c I +, we get the 4obel operator=
*+
;+./<
7y giving higher weight to the central pi#els this mas helps in providing some degree of smoothening effect and is hence beneficial than the other + mass.
4charr 3perator 4charr operator with ># and >y is as follows=
;+.1<
4obel operator, though can reduce artifacts that are associated with the central differences operator, but they do not have perfect rotationa l symmetry. 4charr operator, on the other hand, optimi$ed this property.
etectin% ed%e! u!in% t#e !econd deri+ati+e tec#ni8ue
Edge pi#els of an image can be detected by searching the $ero:crossings of the second derivative. There e#its + operators in two dimensional images that are associated with the second derivative= Laplacian and 4econd directional derivative
*,
T#e La$acian Tec#ni8ue
;+.5< Chere,
;+.6<
The Laplacian technique can be implemented using the mas displayed below=
The steps of edge detection are as follows=
•
S"oot#enin%= 7lurring the image so as to reduce the noise pi#els from the image.
•
En#ance"ent= 'pplying an appropriate Hlter to enhance the edge quality in the image
;sharpening<. •
etection6 @ind the edge pi#el that must be removed as noise and which should be
retained in the image ;the t#re!#o$din% (globallocaladaptive)) gives the criteria used for detection<.
*-
•
Loca$iation6 @ind the e#act location of an edge. Edge thinning and lining are the
features to cater to during localisation.
8aussian smoothing is always applied to minimi$e the effect of noise before the detection process. This is done because both first and second order derivatives are e#tremely sensitive to noise ;sharp changes in intensity<. Then we compute the edge strength that is the gradient magnitude after which we apply a threshold to chec whether a pi#el belongs to an edge or not. 4mall threshold result in detection of more edge points since result is vulnerable to noise. 3n the contrary, a large threshold can miss mee edge points and can also result in fragmented and discontinuous edges. ' basic approach to eradicate this problem utili$es multiple thresholds to detect edges. The approach starts by maing use of the upper threshold to find the commencement of an edge. 'fterwards, the path of the edge is traced in image pi#el by pi#el, maring an edge whenever the pi#el value is above the lower threshold. This process stops only when the value is less than lower threshold. 4till, choice of appropriate thresholding parameters, and suitable thresholding values is a very huge challenge as it may change over the image. Edge thinning is an important method that is used to remove the unwanted pi#els on the edge of an image. This method is used after the image filtering process and then, the edge operator is applied to detect the edges and afterwards, the edges are smoothened using an appropriate threshold value. This removes all the unwanted points and if applied carefully and cautiously, results in edge pi#els that are one pi#el thic.
Ant Co$on& Oti"!ation
'T colony optimi$a tion ;'&3< is an optimi$ation algorithm inspired by nature, based on the natural phenomenon that states that ants deposit pheromone ;chemical< on the ground in order to mar the desired path that should be followed by other members of the colony. This algorithm is used to solve many problems. '&3 tacles the image edge detection problem that is to gather the edge information presented in the image. '&3 is also used for developing heurist ic algorithms for combinatorial problems. 'nt &olony 3ptimi$ation is a process designed to identify pi#els in an image where sharp discontinuities in intensity occur. *.
Different steps of an '&3 algorithm are the following= • • • •
roblem graph representation !nitiali$ing ants distribution ode transition rule heromone updating rule
!n this method, ants travel on a +:D image for constructing a pheromone matri#. The edge information is e#tracted that is used to identify all the edges present in the image. The ants% movement is determined by the local variation of the pi#el intensity values of the image.
!n the model used, each pi#el in the image represents an edge point in the graph. !t represents an edge because the local information of the image%s intensity values determines the heuristic information and hence, is closely related with a pi#el location in the image. 'lso, the components of the transition and pheromone matrices are related with pi#els in the image.
Partic$e S0ar" Oti"iation
43 deals with generating a set of possible solutions called population. The cognitive and social behavior of the swarms influences this technique. Every particle moves in the multi:dimensional space with some velocity. Every particle stores previously visited search space.
This algorithm is guided by + factors=
a< >ovement of particle in local neighborhood. b< >ovement of particle in global neighborhood.
Be!t So$ution! in $oca$ area (Loca$)6 : The particle searches for the best solution in the search
space.
*/
Be!t So$ution in entire area (G$o*a$) = : it is the best solution considering all the particles that
participate in the local solutions. !f an improved solution is found, then the best and local positions are updated.
arameters
it# artic$e o!ition67
i)
Gi I ;Gi), G i+,.,Gi< is the i th particle of the swarm. The particle number is denoted by the first subscript and the dimension is depicted by the second subscript.
ii)
i
t#
artic$e +e$ocit&67
Vi I ;Vi), Vi+,., Vi<
iii)
9*e!t o t#e artic$e (Loca$ *e!t o!ition)67
GbestI;i), i+, (.., i<
i+)
-datin% t #e + e$ocit&67
(+.)
2<
Chere=
iI ;) to m< is the number of swarms. dI ;) to < is objective function%s dimension which needs to be optimi$ed The global best solution of the swarm is g best. !teration number is denoted by .
*0
C is the parameter that controls the swarm%s previous velocity vector in the current one. This tradeoff between local and global e#ploration helps in minimi$ing the number of steps for searching a solution which is optimal.
The cognitive parameter is J. The social parameter is K. The random numbers ) and + are between 2 and ).
v<
-datin% t#e o!ition=:
;+.))< Chere= q I correction factor that helps n speeding up the convergence process.
&hapter * PROPOSE :ETHOOLOG;
BAC
The edge detection technique based on '&3 utili$es a set of ants that move on a +:dimensional image for the construction of a pheromone matri#. Every entry of this matri# gives the edge information of each point of the image. The movement of the ants is controlled by the local variation of the intensity values in the image. The first step is the initiali$ation process. Then iterations are run for constructing the pheromone matri#. !n these iterations, the construction process and the updation process is carried out iteratively. *1
The final step is the decision process which is carried out to determine the edge.
a< !nitiali$ation rocess The process begins with assigning ' number of ants on an image !. 4i$e of the image is >) M>+. Every pi#el of this image is considered as a node. The pheromone matri# is denoted by >(?) and its initial value is set to be a constant N init for every component of the matri#..
b< &onstruction rocess 3ne ant is randomly chosen from the T ants at the n:th step of the construction process. This ant will mae 9 movement:steps on the image. The transition probability defines the ant%s movement from the node ;l,m< to its neighboring node ;i, j< as=
;*.)< Chere, the value of the pheromone at node ;i, j< is denoted by N
;nO)< i,j
, the neighborhood nodes of the
node ;l,m< are denotes as P ;l,m< , the heuristic information at the node ;i, j< is denoted as Q i,j . The influence of the pheromone matri# is represented by J and the influence of the heuristic matri# is represented by K.
The heuristic information is calculated as follows=
;*.+< "ere, ! i,j is the pi#el%s intensity value locate d at the position ;i, j< of the image I, Vc;!i,j< is a function of c which is a local group of pi#el s ;referred to as the clique<, the value of which depends on the image%s intensity values variation on the clique c as follows=
*2
*.) ' local configuration at the ! i,j pi#el position . The gray square mars the pi#el !i,j. The variation Vc;!i,j < is calculated by
;*.*< @ollowing 0 functions are considered for f;.< =
;*.0a<
;*.0 b<
;*.0 c<
+3
;*.0 d<
is a normali$ation factor. The shape of the functions is adjusted using the parameter R. Either the 0 connectivity or 5 connectivity neighborhood is considered as permissible range of ant%s movement ; P ;l,m< < .
*.+ ermissible range for ant%s movement:;a< 0:connectivity ;b< 5:connectivity
c< ?pdation rocess Two updates operations are performed to update the pheromone matri#. ). 'n update operation is carried out after the movement of every ant within every construction: step. The value of each component is updated as follows=
;*.-<
"ere, S denotes the evaporation rate and
+*
'fter all ants have moved within each construction:step, the second update is carried out as follows=
;*./< "ere, denotes the pheromone decay coefficient.
d< Decision rocess
!n this final stage of the process, a threshold T is applied on the Hnal pheromone matri# N
;<
in
order to chec at every pi#el location whether it is edge or not . This threshold T is calculated adaptively . The mean value of the pheromone matri# is chosen as the initial threshold T ;2<. Then the entries of the pheromone matri# are divided into two categories by comparing them with threshold T;2<. Then the average of two mean values of each of the two categories is computed and is set as the new threshol d. This process is repeatedly carried out until there is no more change in the threshold value ;according to a user:deHned tolerance U<. The above can be summari$ed as follows.
4tep )= T;2< is initiali$ed as=
;*.1< the iteration inde# l is set to $ero .
4tep += The entries of the pheromone matri# N ;< are separated into two categories by comparing with T ;l<, the Hrst category comprises of entries of N that have values smaller than T
;l<
, and the
second category comprises of the remaining entries of N. e#t, the mean of each of the above two classes is calculated as=
;*.5<
++
;*.6< where
;*.)2<
;*.))<
;*.)+<
;*.)*<
4tep *= iteration inde# is incremented as l I l ), and the threshold is updated as follows=
;*.)0< 4tep 0= !f the difference WT;l<: T;nO)
;*.)-<
The algorithm based on 43 uses an optimi$ation method to detect edges in images corrupted with noise. The constraints are handled using a preservation method. The 43 based algorithm effectively ma#imi$es the interest distance ;that is distances between pi#el values in the two regions separated by a continuous edge< and minimi$es the intra:set distance ;that is the distance +,
between the pi#el intensities within each region<. !t accurately detects thin, continuous and smooth edges in comple# images. ' single initiali$ation of the algorithm is sufficient for all the runs maing the algorithm faster. @or representing these curves in this search space, an encoding scheme is used. @or the evaluation of each curve, a fitness function is used to measure how similar are the pi#els within each sub:region and how different are they between two sub: regions. Encoding 4cheme
' set of pi#els are processed at a time in this method rather than one pi#el for e#tracting the global structure of the edge. 'lso to avoid noise and false detections, the approachtaes into account a large area instead of a small one.
@itness function The average edge magnitude of all pi#els on the edge decides the fitness value of each edge.
Edge magnitude measure
To reduce sensitivity to noise, instead of using first or second derivative another method is used to calculate edge magnitude. The eight possible directions of movement are used to classify the neighborhood of each pi#el into two regions as follows=
*.* Eight possible directions for moving from one pi#el to its neighbor
+-
Edge magnitude is modeled as a function of interest and intra:set distances= larger the inter:set distance between these two regions is great and smaller their intra:set distances, greater would be the edge magnitudeX and the edge magnitude will be small in case of small inter:set distance and large intra:set distances. !n movement direction m the edge magnitude at pi#el is calculated as=
;*.)/< Chere,
;*.)1< Chere, avgm,d;< denotes the the average intensity of the dar regions for direction of movement m for pi#el and is calculated as=
;*.)5< 'nd, avgm,l;< denotes the the average intensity of the light regions for direction of movement m for pi#el and is calculated as=
,
;*.)6<
!i is the ith pi#el%s intensity in the respective setX and w) denotes a weight factor. The pairwise subtractions of pi#el values is calculated and added in a region to give the intra:set distance as follows=
;*.+2<
>4 @actor for Edge Thinning +.
!t e#tracts local ma#imum of the edge magnitude along the direction of the gradient vector. The non:ma#imal edges are suppressed. for each direction m and the Edge>agm of a pi#el on a continuous edge is compared to the Edge>agm of pi#els )to / on both sides of the edge. The >4 factor in each direction.
;*.+)< >4 is an integer and its value lies in the range 2 to /. Chen is a local ma#ima in the direction m, then >4 factor in m direction is larger.
!f the estimation of the edge direction is not done correctly, it is possible that some of the real edge pi#els might be discarded by the >4 algorithm resulting in appearance of broen edges on the edge map. Therefore, it is not necessary to remove a non:ma#ima edge. This method eeps the non:ma#ima edge intact. 7y multiplication with a number less than ) it reduces the edge magnitude of the non:ma#ima edge. This is close to ) for the edges whose >4 factor values are high, and is nearby $ero for the ones whose value is low. @or scaling a >4 factor value to fall in the range from 2 and ) and generate this number, a sigmoid function is used. "ence the total edge magnitude of each pi#el in m direction is calculated as=
;*.++<
'n edge pi#el may be falsely detected as a non:edge if it has an edge magnitude that is low compared to the threshold values. Thus, e#isting methods of image thresholding often result in broen edges in the edge detection. To minimi$e the drawbac of using these methods, another sigmoid function is used. Estimation of the possibility score of the pi#el is done by using a sigmoid function and is given by:
;*.+*<
+/
?niformity @actor
The pi#el values of immediate neighbors can be used to estimate the value of pi#el for the broen edges as the pi#els that lie on an edge have similar intensity values. Thus pi#el intensities can be used for evaluating a curve. !n order to guage intensity similarity of pi#els lying on a curve the uniformity factor is used=
;*.+0<
Chere, !i :: value of the pi#el i on curve &. ?;&< is a real number and its value ranges from 2 to ). Low value of ?;&< signifies a better fit on the actual edge, since pi#el values are similar along the curve. The uniformity factor of curve along with the mean of the possibility scores of the pi#els on a continuous edge can be used to find out the total possibility score of the curve lying on a continuous edge. !n order to ma#imi$e the probability of the pi#els on the curve and minimise its uniformity factor the possibility score is calculated as follow=
;*.+-<
&urvature &ost of &ontinuous Edges
+0
Edge orientation of pi#els adjacent to each other on a smooth edge is very similar. !n order to minimise the effect of producing jagged edges a curvature cost of a continuous edge is used and it is calculated as follows=
;*.+/<
Chere, mi :: movement direction i w*:: weight factor.
The mean of the curvature cost of all individual pi#els on the curve is used to calculate the curvature cost of curve & as follows=
;*.+1<
@itness @unction with Two &onstraints
!n order to fit more accurately on a continuous edge the possibility score of a curve should be ma#imi$ed and to get smooth edges the curvature cost should be minimi$ed. !ncorporating these two conditions the following fitness function is used for evaluating the curve &=
@itness;&< I 4core;&< O&&ost;&<
Estimation of T"
'fter applying an edge operator the resultant image is binarised using a global thresholding technique. !t wors efficiently to classify a group of pi#els into two subsets ;edge and non:edge<,
+1
ma#imi$ing the discriminating criteria of interset variance between the intensities of the pi#els belonging to these subsets. i#els whose magnitude is less than t are put in the first set and those with magnitude greater than t are put in the second set. Let Y);t< :: average edge magnitude of the pi#els in the first subset Y+;t<:: average edge magnitude of the pi#els in the second subset );t< ::number of the pi#els first subset +;t<:: number of the pi#els second subset Then, Y';t<::The average edge magnitude of all pi#els can be calculated as follows=
;*.+5<
Z';t< is the inter:set variance between these two subsets and is calculated as =
;*.+6< T" is the value t that corresponds to the ma#imum of Z ';t<.
PROPOSE EGE ETECTION -SING OPTI:I@E ANT COLON; ALGORITH: ON A PRE7PROCESSE I:AGE
Procedure6
). 9E:93&E44!8 4TE4=
a<
4moothening=
!n order to remove noise, blurring is done. The image is first smoothed by applying 8aussian filter with a standard deviation of 2.5 to prevent that noise is mistaen for edges. +2
b<
@inding edge strength and edge intensifier in all directions of a pi#el=
@inding the edge strength in all eight directions ;m< of a pi#el ;using the si# mass displayed in @ig. *.*< along with the edge intensifier value ;formula stated below< in these directions that, as the name suggests, intensifies the fact whether a pi#el is a part of an edge or not. Edge[sumA*G*B;i,j,m
;*.*2<
Chere iIinde# of row of image, jIinde# of column of image, mIdirection c< &omputing >4 for edge thinning= The method to compute >4 is similar to what is stated in 43 algorithm mentioned above ;*.+)<. d< &omputing total edge strength of a pi#e l= The formula to compute total edge strength of a pi#el in all directions is as follows= Tota$ed%e!tren%t#(iDD") Fed%e"a%(iDD") (2J(n"!(iDD")7')). ;*.*)<
e< &omputing local edge strength of a pi#el= Local[edge[strength;i,j< I ma#mI)=5;Total[edge[strength;i,j,m<<
;*.*+<
+. 'L\!8 T"E '&3 'L839!T">=
The four steps of '&3 algor ithm stated above are applied with v matri# being the Local_edge_strengthmatri#
a) !nitiali$ation The process begins with assig ning ' number of ants on an image !. 4i$e of the image is >) M>+. Every pi#el of this image is considered as a node. The pheromone matri# is ,3
denoted by >(?) and its initial value is set to be a constant N init for every component of the matri#..
b< &onstruction 3ne ant is randomly chosen from the T ants at the n:th step of the construction process. This ant will mae 9 movement:steps on the image. The transition probability defines the ant%s movement from the node ;l,m< to its neighboring node ;i, j< as=
;*.**< Chere, the value of the pheromone at node ;i, j< is denoted by N
;nO)< i,j
, the neighborhood nodes of
the node ;l,m< are denotes as P ;l,m< , the heuristic information at the node ;i, j< is denoted as Qi,j . The influence of the pheromone matri# is represented by J and the influence of the heuristic matri# is represented by K.
The heuristic information is the local edge magnitude as computed above=
Qi,jILocal[edge[strength;i,j<
;*.*0<
The permissible range of ant%s movement ; P ;l,m< < is either given by 0 connectivity or 5 connectivity neighborhood.
c< ?pdation Two updates operations are performed to update the pheromone matri#. ). 'n update operation is carried out after the movement of every ant within every construction:step. The value of each component is updated as follows=
,*
;*.-<
"ere, S denotes the evaporation rate and 'fter all ants have moved within each construction:step, the second update is carried out as follows=
;*./< "ere, denotes the pheromone decay coefficient.
d< Decision E#periments show further improvement in results by applying the 3tsu%s method for decision maing rather than the global thresholding technique. E#haustive searching for the threshold minimi$ing the intra:class variance is the main aim of 3tsu%s method. !t is depicted as a weighted sum of variances of the two classes=
;*.*1<
4* I probabilities of the two classes t 5 threshold
I variances of these classes . ,
Variance is denoted in terms of class probabilities 4* an d mean of the class 4* is evaluated from the histogram as t= ,+
;*.*5<
.
, The mean of the class
;*.*6<
is=
;*.02<
I value at the center of the bin of the
th
histogram.
@inal Threshold ;Tfinal< I ma#imum The] class probabilities and class means can be computed iteratively. The steps for the same are as follows=
"istogram and robabilities of each intensity level are computed.
!nitial
'll possible thresholds
and
are setup. ma#imum intensity are iterated and the
following steps are done
'nd
are updated.
are computed.
@inal threshold is given by the ma#imum
,,
.
&hapter 0 E9PERI:ENTAL RES-LTS
'lgorithm )
(1)
,-
0.) Test !mage= &ameraman
0.+ 9esults obtained by incorporating equation *.0a,*.0b,*.0c,*.0d
(2)
,.
0.* Test !mage= Lena
0.09esults obtained by incorporating equation *.0a,*.0b,*.0c,*.0d
'lgorithm +
,/
(1)
0.- Test !mage= Lena
0./ 9esult of applying 43 based approach
(2)
,0
0.1 Test !mage= &ameraman
0.59esult of applying 43 based approach
roposed algorithm ,1
1
0.6 Test !mage= Lena
0.)29esult of applying proposed optimi$ed '&3
(2) ,2
0.)). Test !mage= &ameraman
0.)+. 9esult of applying proposed optimi$ed '&3
-3
&hapter CONCL-SION Edge detection is an important part of image processing. !t is beneficial for many research areas of computer vision and image segmentation. !t provides many important details for high level processing tass lie feature detection etc. This report discusses the achievement obtained by implementing an '&3 based approach for edge detection. E#perimental results show the feasibility of the method in identifying edges in images. The report also discusses the implementation of a 43 based approach for detection of edges in the image. E#perimental results show that our proposed algorithm used in conjunction with '&3 effectively ma#imi$es the distances between pi#el intensities in the two regions ;inter:set distance< and minimi$es the distance between the pi#el intensities within each region ;intra:set distance<, and detect thin, smooth and continuous edges in comple# as well as simple images.
-*
BIBLIOGRAPH;
A)B ^ing Tian, Ceiyu \u, and 4hengliGie, “An Ant Colony Optimization Algorithm For Image
Edge Detection”+225 !EEE &ongress on Evolutionary &omputation ;&E& +225<
A+B ".:7. Duan, Ant Colony Algorithms: heory and Applications. 7eijing= 4cience ress, +22-.
A*B >. Dorigo, V. >anie$$o, and '. &olorni, _'nt system= 3ptimi$ation by a colony of cooperating agents,` IEEE rans! on "ystems# $an andCy%ernetics# &art ' , vol. +/, pp. +6F0), @eb. )66/.
A0B 9. &. 8on$ale$ and 9. E. Coods, Digital Image &rocessing. rentice "all, +221.
A-B 4. E. ?mbaugh, Computer Imaging: Digital Image Analysis and &rocess( ing . &9& ress, +22-.
A/B D.:4. Lu and &.:&.&hen, _Edge detection improvement by ant colony optimi$ation,` &attern
ecognition *etters, vol. +6, no. 0, pp. 0)/F0+-, +225. A1B ". an, L.Cang, and 7. Liu, _article swarm optimi$ation for function optimi$ation in noisy environment,` Applied $athematics andComputation, vol. )5), no. +, pp. 625F6)6, +22/.
A5B . E. arsopoulos and >. . Vrahatis, _9ecent approaches to global optimi$ation problems through particle swarm optimi$ation,` +atural Computing, vol. ), pp. +*-F*2/, +22+.
A6B>. Dsrco and L. >. 8ambardella, _'nt colony system= ' cooperative learning approach to the traveling salesman problem ,` IEEE rans! OnE,olutionary Computation, vol. ), pp. -*F//, 'pr. )661. A)2B >. Dsrco, 8. D. &aro, and T. 4tut$le, "pecial Issue on Ant Algorithms# Future -eneration Computer "ystems, vol. )/, ^un. +222.
-+
A))B 3. &ordon, @. "errera, and T. 4tut$le, "pecial Issue on Ant Colony Optimization: $odels
and Applications# $ath.are and "o/t Computing ,vol. 6, Dec. +22+.
A)+B >. Dsrco, L. >. 8ambardella, >. >iddendorf, and T. 4tut$le, "pecialIssue on Ant Colony
Optimization# IEEE ransactions on E,olutionary Computation, vol. /, ^ul. +22+.
A)*Bennedy, ^. and Eberhart, 9. &. article swarm optimi$ation.roc.!EEE intl conf. on neural networs
Vol.
!V,
pp.
)60+:)605.!EEE
service
center,
iscataway,
^,
)66-.
A)0BEberhart, 9. &. and ennedy, ^. ' new optimi$er using particle swarm theory. roceedings of the si#th international symposium on micro machine and human science pp. *6:0*.!EEE service center,
iscataway,
^,
agoya,
^apan,
)66-.
A)-B Eberhart, 9. &. and 4hi, \. article swarm optimi$ation= developments, applications and resources. roc. congress on evolutionary computation +22) !EEE service center, iscataway, ^., 4eoul, orea., +22).
A)/B 4hi, \. and Eberhart, 9. &. arameter selection in particle swarm optimi$ation. Evolutionary rogramming
V!!=
roc.
E 65
pp.
-6):/22.
4pringer:Verlag,
ew
\or,
)665.
A)1B 4hi, \. and Eberhart, 9. &. ' modified particle swarm optimi$er. roceedings of the !EEE !nternational &onference on Evolutionary &omputation pp. /6:1*. !EEE ress, iscataway, ^, )665
A)5B >. 4etayesh, >. hang, and >. ^ohnston, _!mproving edge detection using particle swarm optimisation,` in &roceedings o/ the 01th International Con/erence on Image and 2ision
Computing# +e. 3ealand!IEEE &ress# 0454# pp! 567! A)6B D.:4. Lu and &.:&.&hen, _Edge detection improvement by ant colony optimi$ation,`
&attern ecognition *etters, vol. +6, pp. 0)/F0+-, >ar. +225. A+2B . 3tsu, _' threshold selection method from gray level histograms,` -,
IEEE rans! "yst!# $an# Cy%ern!, vol. 6, pp. /+F//, ^an. )616.
A+)B >. 9andall and '. Lewis, _' parallel implementation of ant colonyoptimi$ation,` 8ournal
o/ &arallel and Distri%uted Computing, vol. /+,pp. )0+)F)0*+, 4ep. +22+.
A++B ". Liu, E. "owely, and ^. Duggan, _article swarm optimi$ation with gradually increasing directed neighbourhoods,` in &roceedingso/ the 59th Annual Con/erence on -enetic and
E,olutionary Computation.ew \or, \, ?4'= '&>, +2)), pp. +6F*/.
--