Edge Detection via Edge-Strength Estimation Using Fuzzy Reasoning and Optimal Threshold Selection Using Particle Swarm Optimization

Anedgeisasetofconnectedpixelslyingontheboundarybetweentworegionsinanimagethatdiffersinpixelintensity.Accordingly, severalgradient-basededgedetectorshavebeendevelopedthatarebasedonmeasuringlocalchangesingrayvalue;apixelis declaredtobeanedgepixelifthechangeissignificant.However,theminimumvalueofintensitychangethatmaybeconsideredto besignificantremainsaquestion.Therefore,itmakessensetocalculatetheedge-strengthateverypixelonthebasisoftheintensity gradientatthatpixelpoint.Thisedge-strengthgivesameasureofthepotentialityofapixeltobeanedgepixel.Inthispaper, weproposetouseasetoffuzzyrulestoestimatetheedge-strength.Thisisfollowedbyselectingathreshold;onlypixelshaving edge-strengthabovethethresholdareconsideredtobeedgepixels.Thisthresholdisselectedsuchthattheoverallprobabilityof errorinidentifyingedgepixels,thatis,thesumoftheprobabilityofmisdetectionandtheprobabilityoffalsealarm,isminimum. Thisminimizationisachievedviaparticleswarmoptimization(PSO).Experimentalresultsdemonstratetheeffectivenessofour proposededgedetectionmethodoversomeotherstandardgradient-basedmethods.


Introduction
Edge detection is an essential and important first step in object identification.An edge may be defined as a set of connected pixels lying at the boundary between the foreground and the background.Therefore, edge detection algorithms generally rely on detecting discontinuities within an image.Several gradient-based edge detectors are available in the literature which are based on measuring local changes in gray value; a pixel is declared to be an edge pixel if the change is significant.Accordingly, the underlying principle in most edge detection techniques is to compute the first-or secondorder derivative of the intensity function within the imagedetectors based on the first derivative looks for points where the derivative value is large while those using the secondorder derivative find edges at zero-crossings of the image [1].Several gradient operators, such as the Roberts, Prewitt, Sobel, and the Laplacian masks, exist which are used to estimate the first-and the second-order derivatives [2].However, these detectors are generally very sensitive to noise and hence perform poorly in case of noisy images.In [3], Canny proposed a method to counter this noise problem by convolving the image with the first-order derivatives of Gaussian filter prior to edge detection.Some other edge detectors that incorporate linear filtering, local orientation analysis, fitting of analytical models, and local energy are available in the literature [4][5][6][7].
However, the operators mentioned above are referred to as "noncontextual" or general edge detectors since they do not make any distinction between edges originating from textured regions and object boundaries."Contextual" edge detectors, on the other hand, selectively detect contours (object boundaries) that are of interest in the context of a specific computer vision task by taking into account additional 2 Advances in Fuzzy Systems information around an edge, such as local image statistics, image topology, perceptual differences in texture, and edge continuity.Contour detectors are mainly divided into local and global operators.Local detectors are mainly based on differential analysis, statistical approaches, phase congruency, rank-order filters, and their combinations.The latter class of detectors include computation of contour saliency, perceptual grouping, relaxation labeling, and active contours.The behavior of edges in the scale space has also been critically studied and evaluated [8].Natural images generally contain edges with different levels of blurring.Further, the human visual system perceives different frequency ranges differently.Accordingly, multiresolution analysis finds importance in contour detection.Multiresolution contour detection may be classified into edge focusing and position-dependent blurring.Edge focusing can achieve both high noise rejection and good edge localization but at the cost of increased computational cost.Position-dependent blurring, on the other hand, is a better option for images that contain different degrees of blurring.Inspired by the surround suppression mechanism exhibited by the human visual system, contour detection methods using model for surround suppression via receptive field inhibition have also been developed [9][10][11].The operator responds strongly to isolated lines and edges, region boundaries, and object contours, while suppressing texture edges.This yields better discrimination between object contours and texture edges, thereby improving contour detection performance.A comprehensive review on the various approaches to contour detection that have been developed in the past two decades is available in [12].
Gradient-based method for edge detection faces the challenge of edge localization in images that exhibit smooth transition in gray level.This is due to the ambiguous nature of the edge structures in such images.Also, since no absolute ground truth for the gradient threshold is available, clear demarcation between the pixels with high local intensity gradient (edge pixels) and those with low intensity gradient (non-edge pixels) does not exist.To deal with this ambiguity and vagueness in edge structures, some researchers used fuzzy logic theory in defining edges, as summarized below.
1.1.Fuzzy-Based Edge Detection.Fuzzy logic plays key role in situation of ambiguity.This motivated researchers to employ fuzzy reasoning for edge detection.The earliest and the most typical fuzzy-based edge detection method is due to Pal and King [13] which used fuzzy based logic as a contrast intensifier to detect edges in X-ray image.This was followed by a series of works in the last three decades, [14][15][16][17][18][19][20][21][22][23][24][25][26][27] to name a few.
The method presented by Tao et al. in [14] is based on a set of sixteen fuzzy IF-THEN rules.All these rules are combined to generate a set of potential edge pixels.This method avoids the difficulty of selecting parameter values present in most other edge detectors.Russo and Ramponi used FIRE operator (set of fuzzy inference rules) to detect edges from noiseless as well as noisy images [15].In [16], Russo used 3 × 3 windowbased filtering followed by fuzzy reasoning to detect edges in the presence of noise.A fuzzy classifier was used by Liang and Looney [17] to classify image pixels corresponding to gray level variation in various directions by using a 3 × 3 mask.They used an extended Epanechnikov function as fuzzy set membership function for each class.The class assigned to each pixel is the one with the highest fuzzy membership.A fuzzy-based approach to edge detection in gray-level images is proposed in [18].This fuzzy edge detector involves two phases: global contrast intensification and local fuzzy edge detection.In the first phase, a modified Gaussian membership function is chosen to represent each pixel in the fuzzy plane.This requires use of some parameters to enhance the image which are obtained by optimizing an entropy function.Rakesh et al. [19] proposed an edge detector in which thresholding is performed using statistical principles.Local standardization of threshold for each individual pixel, depending on the statistical variability of the gradient vector at that pixel, is taken into account for image binarization.In [20], Mendoza et al. applied Sobel operator on a digital gray-scale image and calculated the intensity gradients at each pixel position.This measure of intensity gradient gives the probability of occurrence of an edge.High pass and low pass filter masks are used to detect object boundaries in low contrast region.Finally, type-2 fuzzy inference is used to detect edges.Edge detection in blurry images was carried out by Wu et al. in [21].For this, contrast of blurry image is first enhanced by means of fast multilevel fuzzy enhancement (FMFE) algorithm and then edges are extracted from the enhanced image by two-stage edge detection operator that identifies the edge candidates based on the local characteristics of the image.A novel edge detector based on fuzzy IF-THEN inference rules to model edge continuity criteria was proposed in [22].Eight masks are used to get the gradient information.The maximum entropy principle is used for adjusting the parameter values and finally a set of fuzzy rules is used to decide edge pixels.Yang modified the classical Pal and King algorithm with a new fuzzy membership function [23].To make the algorithm adaptive, membership function is defined automatically from the threshold of the image.In another paper [24], Madasu and Vasikarla proposed fuzzy edge detection in biometric systems.In this approach, edge detection is carried out by means of global (histogram of gray levels) and local (pixels within a window) information.The local information is fuzzified by employing a modified Gaussian membership function.Alshennawy and Aly proposed a method in [25] that is based on fuzzy logic reasoning for edge detection in digital images without determining the threshold value.The proposed approach begins by segmenting the images into regions using floating 3 × 3 binary matrix and finally the edge pixels are mapped to a range of values distinct from each other.An adaptive neurofuzzy inference system (ANFIS) for edge detection in digital images was used by Zhang et al. in [26].The internal parameters of the proposed ANFIS edge detector are optimized by training with the help of very simple artificial images.The algorithm uses 81 rules and four 3 × 3 masks to detect edges in four directions.In [27], Melin et al. used morphological gradient and fuzzy logic to detect edges and an interval type-2 fuzzy inference system (IT2FIS) are used for improving the edge detection.
Advances in Fuzzy Systems 3 1.2.Edge Detection Using Evolutionary Algorithms.Natureinspired evolutionary algorithms like PSO, bacterial foraging algorithm (BFA), ant colony optimization (ACO), genetic algorithm (GA), and so forth have recently been also applied in solving many complex problems including edge detection.A GA-based edge detection technique for texture image was proposed as early as in 1997 [28].In this method, the edge detection problem is formulated as a combinatorial optimization problem and detection of the edge is executed according to the variance of texture feature in the local area.The candidate edge regions are selected first and then GA is applied in order to decide the optimum edge regions.A novel approach for edge detection based on the theory of universal gravity was presented in [29].The algorithm assumes that each image pixel is a celestial body with a mass represented by its gray-scale intensity.Accordingly, each celestial body exerts force onto its neighboring pixels and in return receives force from the neighboring pixels.These forces can be calculated by the law of universal gravity.The vector sum of all gravitational forces along the horizontal and the vertical directions is used to compute the magnitude and the direction of signal variation.Edges are characterized by high magnitude of gravitational forces along a particular direction and can therefore be detected.Edge detection based on the fusion of fuzzy heuristic and PSO has been developed in [30].Edge detection using ant colony optimization and adaptive thresholding was proposed in [31].Ant colony is used to obtain well-connected edge-map.Ant movements are guided by local variation in intensity values.A novel edge detection technique that combines BFA with probabilistic derivative was proposed by Verma et al. in [32].In this approach, the direction of movement of the bacteria decided by probability matrix is computed using derivatives along the possible edge directions.To deal with noisy images, this method is modified in [33] by using fuzzy derivative in place of probabilistic derivative.A reliable and accurate method of edge detection via tuning of parameters in BFA-based optimization has also been proposed recently in [34].

Objective of the Paper.
In gradient-based image edge detection, thresholding is always a point of concern.Performance of classical edge detectors is very much dependent on the value of threshold chosen.This makes the use of these edge detectors relying on heuristic value manually selected by the user.However, proper choice of the threshold is necessary for selective detection of "contextual" edges that generally form object contours and region boundaries while leaving out "noncontextual" textured edges.Accordingly, in our work, we aim at developing user independent automatic method for determining the optimal threshold value such that only the object contours and region boundaries, which are relevant to object recognition, shape analysis, and image segmentation point of view, are detected.
Recently, we proposed a novel edge detection technique that uses a combination of fuzzy reasoning as well as threshold optimization for the purpose of edge detection [35].The proposed method starts with intensity gradient calculation, similar to other gradient-based edge detectors.Following this, unlike conventional gradient-based edge detectors, we use a set of fuzzy rules to measure the possibility of a pixel to be an edge pixel rather than taking a hard decision at this stage.We refer to this measure as "edge-strength."Edgestrength at every pixel point is estimated using a fuzzy rulebased inference mechanism.Pixels are subsequently classified as edge or non-edge pixels on the basis of an optimal edgestrength threshold.This optimal threshold is calculated such that the overall probability of error in edge detection is minimized.We propose to employ particle swarm optimization (PSO) [36] technique for the purpose of minimization wherein the objective function is the sum of the probability of misdetection and the probability of false alarm.The purpose of using PSO for minimization is that it is relatively simple metaheuristic algorithm that is easy to implement and capable of dealing with complex search spaces where only minimum knowledge is available.PSO provides relatively fast convergence to the global minimization through a heuristic search within a search space consisting of infinite search points.In this paper, we describe our earlier proposed edge detection algorithm in more details.This is presented in Sections 2 and 3. Our proposed method for edge-strength calculation using fuzzy rules is described in Section 2 while our proposed optimal threshold selection procedure is given in Section 3. In Section 4, we compared our proposed method with some other previously reported methods of edge-detection.Finally, we draw our conclusion in Section 5.

Proposed Fuzzy Rule-Based Edge-Strength Calculation
The underlying principle behind gradient-based edge detection is to calculate the intensity gradient at every pixel point in the image and then labeling those pixels as edge pixels where the intensity gradient is high.Therefore, it is necessary to define a criterion for deciding high and low intensity gradients.In our proposed method, gradient at each image pixel is calculated by any available gradient operator following which a set of fuzzy rules is used to decide whether the edgestrength at a pixel point is low, medium, or high.This way an edge-strength map of the complete image is obtained.We propose to use fuzzy theory for estimating the edgestrength at every pixel point in the input image.In our proposed approach, we first calculate the intensity gradients   and   along the horizontal and vertical directions, respectively, at every pixel (, ) in the image.Next, we determine the edge-strength at that pixel point using several fuzzy rules.A fuzzy inference system that uses these fuzzy rules gives a measure of the edge-strength which is subsequently fuzzified to assess the extent to which the pixel relates to a true edge in the image.
In our proposed method for edge detection, we first determine the edge-strength so that edges can be detected appropriately.For this, we propose to use some "IF . . .THEN . .." fuzzy rules and estimate the edge-strength using a fuzzy rule-based inference mechanism.A fuzzy rule typically includes a group of "antecedent clauses" which define conditions and a "consequent clause" which defines the corresponding output action and/or conclusion.These fuzzy rules give directives much similar to human-like reasoning.Such a rule, which is expressed in plain linguistic form, is translated into the more formal structure of a fuzzy operator.
As said above, edge pixels are identified by measuring local change in intensity followed by thresholding.The change in intensity may be measured by taking the first derivative of the image function.The derivative quantifies the rate of change in the intensity and hence yields high values at points of rapid transition.In continuous domain, the rate of change of a 2D image intensity function (, ) is given by the gradient vector, defined as where   and   denote the rate of intensity change along the horizontal (-axis) and vertical (-axis) directions, respectively.The magnitude of the gradient vector ∇f, referred to as gradient, gives the measure of the rate of change in intensity at the pixel location (, ).This is calculated as To reduce the computational burden, the gradient is sometimes approximated as However, the degree of edginess or edge-strength at a pixel point is to some extent a subjective issue that may not be necessarily quantified in terms of   and   , as in (2) and (3) above.On the other hand, the edge-strength at a point is in every way related to the rate of change in intensity at that point.That means the degree of edge-strength at a pixel point may be estimated on the basis of combined   and   information.This may be accomplished using fuzzy reasoning and fuzzy inferencing, the way similar to the human reasoning.
In discrete domain, as in case of digital images, it is a common practice to use the first difference in place of the firstorder partial derivative.Accordingly, the digital gradients are generally computed using gradient operators consisting of two masks: one mask for computing the horizontal gradient   and the other for computing the vertical gradient   .Several gradient operators, such as the Roberts, Prewitt, and Sobel masks, are available in the literature for that purpose [2].In our method, we propose to use any such gradient operator for computing the gradients   and   at a point (, ) in the image.These two gradient values are then combined to determine the edge-strength at that point using fuzzy reasoning.Thus, our proposed approach differs from the conventional gradient-based edge detectors.Our proposed method for edge-strength calculation uses deductive fuzzy inference system based on a set of four fuzzy rules, as stated below.(i Thus, our fuzzy system is a two-input and one-output system: two input variables (antecedent clauses) are the two gradients   and   , and the resultant output variable (consequent clause) is the normalized edge-strength (, ), at pixel position (, ) in the image.These four IF-THEN rules include two conditions (antecedent clauses) about the input variables and specify a consequent clause related to the output variable.Antecedent clauses are linked by fuzzy AND operator.Each clause is completely defined by the shape and position of a fuzzy set, which maps the corresponding variable to the real interval [0, 1].Since the two input variables   and   are measures of the same quantity (intensity gradient) differing only in their directions of measure (horizontal and vertical directions), they may be defined by the same set of fuzzy sets.Two fuzzy sets for the antecedents and three fuzzy sets for the consequent are used, as represented in Figures 1 and 2. Fuzzy sets for the antecedents are labeled as "low gradient" and "high gradient." Fuzzy sets for the consequent are "low edgestrength, " "medium edge-strength, " and "high edge-strength." The above stated fuzzy rules are combined using Mamdani's max-min inference method followed by centroidbased defuzzification.A detailed description of the inference mechanism can be found in [37].Thus, the "edge-strength" (, ) is calculated on the basis of the extent of horizontal and vertical intensity gradients at pixel location (, ) in the input image.

Edge-Strength Threshold Selection
After deriving the information regarding edge-strength of an image, as discussed above, now the question is how to decide the threshold value automatically to differentiate edge pixels from non-edge pixels in the image.This implies that the choice of threshold is very important in detecting edge pixels-higher value of threshold may result in misdetection while lower value of threshold may result in false detection.In other words, the performance of any gradient-based edge detector depends on the choice of threshold.
The edge-strength calculation step described above maps the input image to a gray-scale edge-map-the gray value at every pixel location corresponds to the edge-strength of that pixel, that is, how much likely is that pixel to be an edge, measured in the range from 0 to 1.However, a binary edgemap is generally desired which shows whether a pixel is an edge or not an edge.So, following the above edge-strength calculation step, a decision making step is necessary through which the pixels in the edge-map are classified into two categories, namely, "edge pixel" and "non-edge pixel." Thus, the problem at hand essentially boils down to image binarization via 2-class pattern classification that involves selection of an appropriate decision boundary (threshold).Several methods of an optimal threshold for image binarization have been reported in the literature and discussed below.

Methods for Threshold Selection for Image Binarization and/or Edge Detection.
Thresholding is a commonly used technique in image segmentation and binarization.Selecting the correct threshold is a critical issue-lower value of threshold increases false alarm while higher value of threshold increases the probability of misdetection.Accordingly, many researchers attempted to address this issue by devising techniques for selection of optimal threshold.One such early attempt in this direction by entropic thresholding was proposed by Pun [38].Kapur et al. [39] also attempted automatic thresholding using entropy of the histogram for gray level images.In [40], a method for automatically selecting threshold is presented which uses a model based on the weighted sum of two gamma density functions corresponding to edge and non-edge pixels.A robust automatic threshold selection algorithm was introduced in [41] which is based on the average of the gray levels of the pixels in an image weighted by the response of a specific edge detector at each pixel.A technique of three-level thresholding based on probability partition and fuzzy 3-partition has been presented in [42] in which a relationship between a probability partition and a fuzzy partition in thresholding is given.This relationship and the entropy approach are used to derive a thresholding technique to select the best fuzzy partition.In [43], El-Khamy et al. considered the problem of fuzzy edge detection as a twolevel thresholding problem where the goal is to partition the image domain according to the gradient value into two fuzzy partitions (regions).These two regions relate to pixels that acquire low local gradient value (smooth region) and pixels that acquire high local gradient value (edge region).Using the relation of the probability partition and the fuzzy 2-partition of the image gradient, the best gradient threshold is selected via minimization of fuzzy entropy.An automatic threshold selection method was proposed in [44] which considers Proposed (Th = 0.35) Figure 5: Edge detection results of "goat" image: desired edge output of "goat" image; Sobel, Canny's, and Roberts methods using thresholds = 0.05 and 0.15; fuzzy-BFA method; proposed method with fixed thresholds (0.18 and 0.35) and optimal threshold.
both statistical and spatial correspondence between detected edge points.Local thresholds are adaptively selected in [45] taking into account the activity masking characteristic of the human visual system.The selected local thresholds are then utilized for edge labeling in the gradient image.An adaptive thresholding-based edge detection method using morphological operators is presented in [46].A double-threshold image binarization method based on the edge detector was proposed in [47] which is based on the edge and intensity information.Image binarization is done in two stages using high and low threshold values.Zhang et al. presented fuzzy edge detection based on Gauss function and automatic selection of threshold parameter by maximum variance [48].Li and Gao [49] proposed an edge detection algorithm that is based on fuzzy 2-partition entropy approach.The authors addressed the problem of detecting the edge pixels in graylevel image by maximum fuzzy 2-partition entropy principle.Entropy function used to justify that the information of an image is mostly retained after thresholding.Another entropybased flexible thresholding algorithm was proposed in [50].Three different methods for adaptive thresholding using fuzzy approach, statistical parameters, and fuzzy reasoning were proposed in [51].

Proposed Method for Optimal Edge-Strength Threshold
Selection.In our work, we propose using Bayes decision theoretic approach for optimal threshold selection so as to minimize the overall error in categorizing the pixels into "edge pixels" and "non-edge pixels." Error occurs when an actual edge pixel is categorized as "non-edge pixel" (misdetection) or vice versa (false alarm).
According to Bayes decision rule [52], a pixel at location (, ) with edge-strength  is marked as an edge pixel if where (edge | ) and (no edge | ) denote the conditional probabilities that the pixel is an edge or not an edge, respectively.It follows that the decision boundary (threshold) between non-edge and edge pixels is given by the edgestrength value  for which Therefore, the task now is to seek for suitable functions defining the conditional probabilities (edge | ) and (no edge | ) such that the overall probability of classification error is minimized.Once these two probability functions are obtained, the required threshold is automatically established.
In connection to the above stated task of finding suitable probability functions, we note the following.
(i) Since a pixel can only be either an edge pixel with some probability or not an edge pixel, these two events are mutually exclusive and form the total probability space.Therefore, we will have (ii) Since the edge-strength is the measure of the possibility of a pixel to be an edge pixel, it is intuitively desired that the probability (edge | ) be a monotonically non-decreasing function of the edge-strength measure .It follows that (no edge | ) will be a monotonically non-increasing function of .
(iii) The demarcation between "non-edge" and "edge" is generally fuzzy.This may be well characterized by defining a range of edge-strength value , say, ( 1 ,  2 ), corresponding to pixels of such ambiguous nature.In other words, pixels with edge-strength Proposed (Th = 0.35) Figure 7: Edge detection results of "elephant" image: desired edge output of "elephant" image; Sobel, Canny's, and Roberts methods using thresholds = 0.05 and 0.15; fuzzy-BFA method; proposed method with fixed thresholds (0.18 and 0.35) and optimal threshold.value in this range will have non-zero probability of being both an edge pixel and non-edge pixel; that is, (iv) Based on the preceding observation, a pixel is definitely an edge pixel if its edge-strength exceeds  2 .
On the other hand, pixels with edge-strength less than  1 are definitely non-edge pixels.Accordingly, we will have

Fuzzy Two-Partition of Normalized Image Edge-
Strength.Following the above discussion, we propose two trapezoidal functions defining (no edge | ) and (edge | ), as depicted in Figure 3.The reason for this particular choice is its simplicity due to the linear nature of the functions in the intervals from  1 to  2 .Nevertheless, some other complex functions represented by higher-order curves in the range ( 1 ,  2 ) may also be used, as per the will of the user.The trapezoidal functions so chosen are completely defined when the values of  1 and  2 are known.The required decision threshold is then obtained as Pixels with edge-strength value above  th will be marked as edge pixels while those with edge-strength less than  th will be classified as non-edges.Thus, the problem of optimal threshold selection now reduces to the problem of finding a pair of suitable values for  1 and  2 such that the overall error in identifying edge pixels is minimized.Error occurs when an actual edge pixel Proposed (Th = 0.35) Figure 8: Edge detection results of "rhino" image: desired edge output of "rhino" image; Sobel, Canny's, and Roberts methods using thresholds = 0.05 and 0.15; fuzzy-BFA method; proposed method with fixed thresholds (0.18 and 0.35) and optimal threshold.
is not detected (misdetection) or when an actual non-edge pixel is marked as an edge pixel (false alarm).The probability of misdetection is given as and the probability of false alarm is calculated as where () is the probability density function of the edgestrength .The overall probability of error in detecting edge pixels in an image is the sum of the above two probabilities.That is,

Defining Objective Function.
In our proposed work, the overall probability of error is used as the objective function, that is, to be minimized in determining the values of  1 and  2 .It is to be noted that although the edge-strength  is a continuous random variable in the range from 0 to 1, in practice we obtain only a finite number of discrete edge-strength values in this range from a finite-sized image having finite number of pixels.In view of this, the above objective function needs to be expressed in its discrete version, given as where   denotes the number of pixels having edge-strength equal to  and  is the total number of pixels in the image.
The summation in the first term is over all available discrete edge-strength values in the range of  1 to  th .Similarly, the summation in the second term is over all discrete edgestrength values in the range of  th to  2 .As discussed above, the aim now is to search for the values of  1 and  2 that minimize  error ; the search space for the same is illustrated in Figure 4.It may be noted that any point on the line  1 =  2 yields  error = 0 and hence corresponds to a trivial solution.Therefore, in order to avoid this trivial solution, the line corresponding to  1 =  2 is excluded from the search space.
The search space mentioned above consists of an infinite number of search points.Therefore, an exhaustive search is not feasible.In view of this, we propose using particle swarm optimization (PSO) [36].It is a metaheuristic search procedure that has the capability of escaping from local minima and converging to the global minimum.PSO is simple, fast, and relatively stable from convergence point of view.This makes PSO a popular choice for carrying out the optimization operation in this particular situation.

Objective Function Optimization
Using PSO.Now as expressed in (13), thresholding can be achieved by optimizing the given function and obtaining the values of  1 and  2 .The steps of the algorithm for minimization of  error using PSO are as follows.
(2) Set a swarm within the search space.The position of every swarm particle in the search space is given by a pair of  1 and  2 values.
(3) Calculate  error for every swarm particle corresponding to its position.
(4) Assign initial  and  values for this swarm;  "personal best" refers to the best position of a swarm particle till now and  "global best" is the position of the particle having minimum  error in the whole swarm.
(5) Run PSO to modify velocity and position of every particle in the swarm using the following equations: x  ( + 1) = x  () + k  ( + 1) , where  is some predefined inertia weight,  1 and  2 are positive constants,  1 and  2 are random numbers between [0, 1], x  () is the position of the th particle at time , and k  () is the velocity of the th particle at time .Generally, a large value of the inertia weight  is desired for global convergence.Note that the location of a particle is restricted at the boundary of the search space if its new position is outside the search space.
(6) Calculate  error for every swarm particle at its new position.The particle is retained at its new position if its recent  error value is less than its previous value; else the particle is moved back to its earlier location.
(7) Update  and  values in the swarm.
(8) Repeat for maximum number of PSO generations.The final solution is given by the  obtained in the final step of iteration.
Thus, the  1 and  2 pair of values corresponding to the final solution in the search space is the desired result.The required optimal threshold is now calculated using (9) and then applied to obtain the final edge-map image.

Experimental Results and Comparison
In our experiments, we applied our proposed method for edge detection on gray and color images and compared its performance with adaptive threshold to that with fixed threshold values.We also compared the performance of our proposed method with three classical edge detectors, namely, Canny, Roberts, and Sobel, and with one of the recently reported algorithms, namely, bacterial foraging edge detection method given in [33].
In a first set of experiments, we used four gray-scale images, namely, "goat, " "hyena, " "elephant, " and "rhino, " available at [53].For each of these images, the associated desired binary contour map, drawn manually by experts, was also available alongwith.The edge detection results obtained in all these cases, by applying the various edge detectors mentioned above, are shown in Figures 5, 6 values, as defined below, for all these cases and tabulated in Table 1.Consider where  is the set of correctly detected contour pixels,  FP is the set of false positives, that is, non-edge pixels detected as edge pixels,  FN is the set of false negatives, that is, edge pixels not detected, and card(⋅) denotes the cardinality of a set.It may be noted that the manually drawn contour does not necessarily always exactly coincide with a local maximum of the gradient magnitude operator.Hence, a contour pixel is considered to be correctly detected if a desired contour pixel is present in a 5 × 5 neighbourhood around the concerned pixel, as suggested in [9].In a second set of experiments, we applied our proposed method for edge detection and the various other methods mentioned above on two gray and four color images as shown in Figures 9, 10, 11, 12, 13, and 14.We observe that the performance of the Sobel and Roberts method is highly dependent on the choice of the threshold and shows high rate of misdetection even at lower threshold values.This problem is taken care of through additional processing such as edgestrength estimation and optimal thresholding in our method, as evident from the results shown.Canny's classical edge detector is considered to be one of the best performing edge detection algorithms available in literature.We observe that while Canny's method is highly dependent on the value of threshold selected, true edges are appropriately detected in our method by automatic thresholding.In case of BFA-based edge detection thick or double edges are obtained while better edge localization is achieved in our proposed method.We also observe that when fixed values of threshold are used in our method, there is more probability of misdetection (for high value of threshold) or more false alarm (for low value of threshold).On the other hand, selection of optimal threshold

Conclusion
This paper presents a fuzzy approach to edge detection via estimation of edge-strength at every pixel location in the input image.Following this, optimal thresholding is achieved by minimizing the probability of error in edge identification.
The method is an extension of the gradient-based edge detectors.Here the horizontal and vertical gradients are combined using some fuzzy rules to give a measure of the edgestrength.Decision regarding pixel to be considered as an edge or non-edge is based on the threshold value selection by optimizing (minimization) the edge detection error.In order to fast search through the infinite number of search points, meta-heuristic optimization approach such as the PSO is employed.Thus, this method does away with manual selection of threshold and hence is free from any user intervention.However, as in case of most fuzzy systems, the performance of our proposed method obviously depends on the choice of the fuzzy sets and the fuzzy membership functions.Therefore, proper choice of the fuzzy functions is necessary to detect true edges in the input image.Experimental results show that the true edges are detected with high efficiency.

Figure 1 :
Figure 1: Membership function plots for fuzzy sets corresponding to low and high intensity gradient (normalized).

Figure 2 :Figure 3 :
Figure 2: Membership function plots for fuzzy sets corresponding to low, medium, and high edge-strength.

Figure 4 :
Figure 4: Search space for optimization to determine the values of  1 and  2 .

Table 1 :
values obtained for different test images.

Table 2 :
Threshold values obtained for different test images.