A Fast Edge Detection Using Fuzzy Rules - IEEE Xplore

4 downloads 263 Views 2MB Size Report
*Faculty of Engineering Science, Computer Science Department, BadjiMokhtar University Annaba, Algeria talai_zoubir@yahoo.com, talaiwah@yahoo.fr.
A Fast Edge Detection Using Fuzzy Rules TALAI Zoubir*, TALAI Abdelouaheb* *Faculty of Engineering Science, Computer Science Department, BadjiMokhtar University Annaba, Algeria [email protected], [email protected] ABSTRACT— In computer vision and image processing edge detection is an important topic. In what follows, a simple edge detection and fast calculation method using fuzzy rules is presented. The fuzzy rule system is designed to model edge continuity criteria. To adjust parameters the maximum entropy principle is used for. We also discuss the related issues in designing fuzzy edge detectors. Every step of evolution of the detector we compare it with popular edge detectors: Canny edge detector. The proposed fuzzy edge detector does not need parameter setting as Canny’s; also it can preserve an appropriate detection in details. High level noise does not affect the detection, in addition itcan work well under situations that other edge detectors cannot. The filtering process is unnecessary because the detector efficiently extracts edges in images corrupted by noise without requiring it. The experimental results demonstrate the superiority of the proposed method. Keywords: Segmentation, Image Processing, Fuzzy Logic, Edge Detection, Maximum Entropy Principle, Fuzzy Inference Rules.

I.

INTRODUCTION

Fuzzy logic theory has been successfully applied to many areas, such as pattern recognition, computer vision, etc. It has also been applied to image segmentation [1]. Edge detectors have been an essential part of many computer vision systems. The edge detection process serves to simplify the analysis of images by drastically reducing the amount of data to be processed, while at the same time preserving useful structural information about object boundaries. There is certainly a great deal of diversity in the applications of edge detection, but it is felt that many applications share a common set of requirements. These requirements yield an abstract edge detection problem, the solution of which can be applied in any of the original problem domains[2]. Edge pixels are defined as locations in an image where there is a significant variation in gray level (or intensity level of color) pixels. The process of edge detection reduces an image to its edge details that appear as the outlines of image objects that are often used in subsequent image analysis operations for feature detection and object recognition [3].

There are many different methods for edge detection [5, 6], such as Sobel filtering, Prewitt filtering, Laplacian of Gaussian filtering, momentbased operators, the Shen/Castan operator and the Canny/Deriche operator[4], but some common problems of these methods are a large volume of computation, sensitivity to noise.[3]proposed a fuzzy edge classifier. It used an extended Epanechnikov function as a membership function (FSMF) for each class where the edge class assigned to each pixel is the one with the greatest membership. [5] used fuzzy approach for road extraction. A road membership value is assigned to each pixel, and a set of 12 fuzzy templates representing basic 2D road structures is used. The algorithm can only detect the bright road with one pixel width in low density aerial images.[6] try to solve two problems related to imprecision in colorimage segmentation processes the first decide whether a set of pixels verify the property “to be homogeneously colored”, the second is to represent the set of possible segmentations of an image at different precision levels. [7] has proposed 16 fuzzy rules for edge detection, with the use of fuzzy entropy for parameters adjustment. II.

THE PROPOSED EDGE DETECTION USING FUZZY RULES

1

2

3

8

P

4

7

6

5

Direction 1

Direction 3

Direction 2

Direction 4

Figure1. Pixels and directions in 3x3 neighborhood Fig. 1 shows the 3×3 neighborhood of pixels about the center pixel p as well as the four directions in which we will calculate gray level differences.

In direction “1” we calculate the gray leveldifference between pixel 1 and 5. In general the gray leveldifferenceis calculated using the following formula: Xi DiffG Gray i – Gray j , where i 1,2, . . . ,4 and j i 4 Where Gray (i) is the gray level of the neighbor pixel i. III.

APPLICATION

First, the four gray level difference values are calculated for each pixel, which will generate,for , the entire image, a difference system 1,2, … , , 1,2, … , , 1,2, … ,4 where M, N are the dimension of the original image. A. The Proposed Model of Edge Pixel

If the differences in the directions

?

2

3

1

2

?

8

P

4

8

P

4

7

6

?

?

6

5

1

2

3

1

?

3

?

P

?

8

P

4

7

6

5

7

?

5

Is large then P is an edge pixel

And S(.) is the Shannon function Sn µ µ log2 µ i 1,2 … ,2M, j 1,2, … .2N, k 1,2, … 4 The fuzzy entropy for each c is computed, 0, 255 . The optimum value copt is the one that satisfies the following: , , |0 255 C. Fuzzy Operators and Fuzzy Inference Rules : Is the MAX operator. : Is the MIN operator. : Is the ordinary complement operator. As shown in Fig. 2, if one of the 4 fuzzy inference rules is satisfied, then the central pixel P is an edge pixel. The fuzzy inference rules can be defined and the corresponding membership values can be computed: 1: 1 2: 2

Figure2. Edge pixel model using directions system

3: 3

_ _ _

1 | |

| |

4: 4

| |

_ _ _ _

B. Membership Function IsLarge X

_ _

_

_ _

2 3 4 1 2 4 1 2 3 1 3 4

In the above equations, DIF_Gray() is defined in § 2. IsLarge is the membership function defined in § 3.2, and Ri(P), i=1, 2, 3, 4 are the membership functions of the fuzzy inference rules R1–R4. Rule 1 means that if the differences in directions (2, 3, 4) “is large”, then the central pixel P is an edge pixel. The Rules 2–4 can be discussed similarly.

IsLarge(X)

1

0

C

Difference X

[-255, 255]

Figure 3. Membership function “IsLarge” This function computes how much the gray level difference is large. Where “C” will be determined by the maximum fuzzy entropy principle. According to information theory [7,20], the greater the entropy, the more information we have in the system. 1

H G, c

4 µ

Where IsLarge G

8: 8

4 2 1 3

1 3 4

A

B

C

D

By applying the above rules using edge continuity, we can overcome the influence of noise, since noise is random, besides its gray level has no continuity in the neighborhood.

Figure 4.(A) Original image “cameraman” (B) Result using canny operator (C) Result using the proposed detector without the application of continuity principle before defuzzification (D) Result of (C) after defuzzification D. Noise Treatment By considering continuity, if a pixel is an edge pixel, then at least two of its neighboring pixels are also edge pixels, and for the ending edge pixel, at least one of its neighboring pixels is an edge pixel. For simplicity, the ending pixels can be ignored, since it will not affect the detection of the entire edge curve. The following rules are needed to deal with the continuity. 5: 5

1

3 1 2

4 3

Rule 5 indicates if P is an edge pixel, then pixel 1 and pixel 5 should also be edge pixels, and the constraint of Rule 1 makes pixel 1 and pixel 5 match with Rule 1, Rule 3 or Rule 4, i.e., they are edge pixels. As shown in Fig. 2a, the central pixel is P, pixels 1–8 are its neighboring pixels, ‘‘?’’s represent the pixels that are not considered in Rules R1-R4.Rule 1, Rule 3, or Rule 4 is applied to P’s left-above neighboring pixel 3. And pixel 1’s 8 neighboring pixels are marked as pixels 1i {i=1, 2, …, 8}. Similarly, Rules 6–8 can be derived.

B

C

D

E

F

Figure 5.(A) Original image (B) Result using canny operator (C) Result using the proposed detector without the application of continuity principle before defuzzification (D) Result of (C) after defuzzification (E) Result using the proposed detector without the application of continuity principle before defuzzification (F) Result of (E) after defuzzification E. Optimization of parameter searching H HMAX

2 2 1 4

7: 7

A

1 2 4

6: 6

4 2

3 2 1

4 3 COPT

3 1 4 3

2 1 4

3 2

Difference X

[-255, 255]

Figure 6.graph representing the evolution of Shannon entropy results If we observe the graph that results from the Shannon entropy, we notice that after reaching the MAX, the result of the equation keeps going down.

Hence, any search is useless when the value of H starts decreasing. Also, the variation of H is very small, so we can increment C by 3 or 4 and still get good results. In addition, the time complexity reduction is quite significant. F. Defuzzification After the application of the inference rules, the fuzzy edge image should be defuzzified. One of the commonly used defuzzification method is the mean of max defuzzification method: 1

,

To resume the process of detection, the following algorithm is written: For each pixel P: Step 1: Compute the gray differences, DIF_Gray(i) = Gray(i) – Gray(j), (i=1,2,..,8 | j=(i+4)mod8), where i is the index of the neighboring pixels. Step 2:Fuzzify the gray level differences DIF_Gray(i) (i=1,2,..,4) based on the membership functions IsLarge, and compute the membership values for the fuzzy inference rules Rj(P), j=5, . . . ,8 respectively. Step 3: Calculateµ(P) = max {Rj(P), j=5,…,8} Step 4: Compute: 1

C

F

Figure7.(A) Original image with “Salt & pepper” Noise 10% (B) Result using canny operator (C) Result using the proposed detector without the application of continuity principle before defuzzification (D) Result of (C) after defuzzification (E) Result using the proposed detector without the application of continuity principle before defuzzification (F) Result of (E) after defuzzification

A

B

C

D

E

F

,

Step 5: Defuzzify the result edge pixel μ non_edge pixel autherwise

A

E

B

D

Figure8.(A) Original image with 50% “Salt & pepper” Noise (B) Result using canny operator (C) Result using the proposed detector without the application of continuity principle before defuzzification (D) Result of (C) after defuzzification (E) application of continuity principle before defuzzification (F) Result of (E) after defuzzification IV.

CONCLUSION

In this article, we did discuss a new technique for edge detection, using fuzzy logic rules, and we have proposed a new calculation method, that optimizes processing time. The approach is easy for implementation and the application of the rules is very simple.

It does not need any specification of parameters like Canny operator, moreover it is very robust against noise unlike other famous detectors. The results were very satisfying, and the detection preserves edge details. REFERENCES [1]

[2] [3] [4]

[5] [6]

[7]

HENG-DA, Cheng and YING, Sun. A Hierarchical Approach to Color Image Segmentation Using Homogeneity. 2000, IEEE Transactions on Image Processing 9, pp. 2071-2082. CANNY, John. A computational Approach to Edge Detection. 1986. IEEE Transactions on Pattern Analysis and Machine Intelligence 8. Vol. 6, pp. 679–698. LIANG, Lily, Rui and LOONEY, Carl, G. Competitive fuzzy edge detection. 2003, Applied Soft Computing 3, pp. 123–137. DERICHE, Rachid and MONGA, Olivier. 3D Edge Detection Using Recursive Filtering: Application to Scanner Images. Institut National de Recherche en Informatique et en Automatique (INRIA). Domaine de Voluceau :s.n., 1988. SOLAIMAN, Basel, R.Fiset and F.Cavayas. Automatic road extraction using fuzzy mask concepts. Amburg,Germany : s.n., 1999. IGARSS’99. pp. 894–896. Chamorro-Martinez, J., Sanchez, D. and Prados-Suarez, B. Segmenting Colour Images on the Basis of a Fuzzy Hierarchical Approach. Granada :s.n., 2003, Mathware& Soft Computing 10, pp. 101-115. LIMING, Hu, HENG-DA, Cheng and MING, Zhang. A high performance edge detector based on fuzzy inference rules. 2007, Information Sciences 177, pp. 4768–4784.