Fuzzy Morphology for Edge Detection and ... - Semantic Scholar

1 downloads 0 Views 639KB Size Report
aerial views, sign boards and biological objects. ... Image enhancement is usually followed by feature detection, ... account by means of fuzzy morphology.
Fuzzy Morphology for Edge Detection and Segmentation Atif Bin Mansoor, Ajmal S Mian, Adil Khan, and Shoab A Khan National University of Science and Technology, Tamiz-ud-din Road, Rawalpindi, Pakistan {atif-cae,ajmal-cae}@nust.edu.pk, [email protected], [email protected]

Abstract. This paper proposes a new approach for structure based separation of image objects using fuzzy morphology. With set operators in fuzzy context, we apply an adaptive alpha-cut morphological processing for edge detection, image enhancement and segmentation. A Top-hat transform is first applied to the input image and the resulting image is thresholded to a binary form. The image is then thinned using hit-or-miss transform. Finally, m-connectivity is used to keep the desired number of connected pixels. The output image is overlayed on the original for enhanced boundaries. Experiments were performed using real images of aerial views, sign boards and biological objects. A comparison to other edge enhancement techniques like unsharp masking, sobel and laplacian filtering shows improved performance by the proposed technique.

1

Introduction

Image enhancement refers to improving the visibility and perception of an image for a specific application, such that its various features are improved. An enhanced image provides additional information which is not easily observable in the original image. Image enhancement is directly linked to the application for which the image is acquired, and is one of the most widely researched area in image processing. Image enhancement is usually followed by feature detection, which can further be used in various applications like object detection, identification, tracking and classification. An effective image enhancement technique can improve the reliability and accuracy of classification. Image enhancement approaches fall into two broad categories namely, spatial domain methods and frequency domain methods [1]. Spatial domain approaches like Log transform, Power-Law transform, contrast stretching, Bit level slicing, Histogram processing, mask filtering like order statistics filters, laplacian filter, high-boost filtering and unsharp masking are based on direct manipulation of pixels in an image. Frequency domain processing algorithms like lowpass, highpass filters and homomorphic filtering are based on manipulation of frequency contents of image. Edge enhancement is an effective image enhancement technique. Edges form the periphery of objects in an image, and separate the foreground from the background. Accurate identification and enhancement of edges G. Bebis et al. (Eds.): ISVC 2007, Part II, LNCS 4842, pp. 811–821, 2007. c Springer-Verlag Berlin Heidelberg 2007 

812

A. Bin Mansoor et al.

improves the image for subsequent applications like object recognition [2], [3], object object registration [4], surface reconstruction from stereo images [5], [6]. Traditional image enhancement techniques have been based mostly on linear approaches. Non-linear approaches are now being investigated for image enhancement. An effective non-linear approach for this purpose is mathematical morphology. The word morphology represents a branch of biology, which deals with the form and structure of animals and plants. Mathematical morphology, in the same context, is a tool for obtaining image structures that are helpful in identifying region shape, boundaries, skeletons etc. Mathematical morphology was introduced in the late 1960s to analyze binary images from geological and biomedical data [7], [8] as well as to formalize and extend earlier or parallel work on binary pattern recognition based on cellular automata and Boolean/threshold logic [9], [10]. It was extended to gray level images [8] in the late 1970s. In the mid 1980s, mathematical morphology was brought to the mainstream of image/signal processing and related to other nonlinear filtering approaches [11], [12]. Finally, in the late 1980s and 1990s, it was generalized to arbitrary lattices [13], [14], [15]. Existing mathematical morpholgy literature is based on crisp set theory. Fuzzy sets, in contrast to crisp sets, can represent and process vague data, handling the concept of partial truth i.e., values between 1 (completely true) and 0 (completely false). A gray scale image can be termed as a fuzzy set in the sense that it is a fuzzy version of a binary image. Similarly, as per Bloch and Maitre [16], for pattern recognition purposes, imprecision and uncertainty can be taken into account by means of fuzzy morphology. In this paper, we propose a new approach for edge detection and image enhancement based upon fuzzy morphology. Our approach gives an adaptive control through which edges of various connectivities in the image can be enhanced as required. This is done by defining the detected boundary lengths in terms of the number of connected pixels of various objects in the image. Briefly, the algorithm proceeds as follows. First, a Top-hat transform is applied to the input image and the resulting image is thresholded to a binary image. Next, thinning of the image is performed using hit-or-miss transform. Finally, the thinned image is processed using m-connectivity to keep only the desired number of connected pixels. The output image is overlayed on the original for enhancing boundaries. The proposed approach can be used for many applications like segmentation, object recognition and pattern matching. Experiments were performed using real images of aerial views, biological objects and text images. A comparison with other popular approaches like unsharp masking, sobel and laplacian is also made.

2 2.1

Background Morphological Image Processing

Morphology is a mathematical framework for the analysis of spatial structures and is based on set theory. It is a strong tool for performing many image processing tasks. Morphological sets represent important information in the description

Fuzzy Morphology for Edge Detection and Segmentation

813

of an image. For example, the set of all black pixels in a binary image is a complete morphological description of the image. In binary images, the sets are members of the 2-D integer space Z 2 , where each element of a set is a tuple (2-D vector) whose coordinates are the (x,y) coordinates of a black or white pixel in the image. Gray-scale digital images can be represented as sets whose components are in Z 3 . In this case, two components of each element of the set refer to the coordinates of a pixel, and the third corresponds to its discrete gray-level value. Sets in higher dimensional spaces can contain other image attributes, such as colour and time varying components [1]. The major part of morphological operations can be defined as a combination of two basic operations, dilation and erosion, and non-morphological operations like difference, sum, maximum or minimum of two images. Morphological operations also make use of a structuring element M ; which can be either a set or a function that correspond to a neighborhood-function related to the image function g(x) [17]. Further morphological operations and algorithms can be obtained from sequencing the basic operations. In general, a dilation (denoted by ⊕) is every operator that commutes with the supremum operation. On the other hand, an erosion (denoted by ) is every operator that commutes with the infimum operation. There is a homomorphism between the image function g and the set B of all pixels with image function value 1. The structuring element M (x) is a function that assigns a subset of N × N to every pixel of the image function. Then dilation, an increasing transformation is defined as  M (x) (1) B⊕M = x∈B

and erosion, a decreasing transformation is defined as B  M = {x|M (x) ⊆ B}

(2)

Similarly, opening of set B by structuring element M is defined as B ◦ M = (B  M ) ⊕ M,

(3)

and closing of set B by structuring element M is defined as B • M = (B ⊕ M )  M

(4)

Further details about morphological operations like Opening, Closing, Top-hat transform, Hit or Miss transform, morphological gradient and further operations based upon use of second structuring elements can be found in [1], [8], [17]. 2.2

Fuzzy Sets

In classical or crisp set theory, the boundaries of the set are precise, thus membership is determined with complete certainty. An object is either definitely a member of the set or not a member of it. However, in reality most sets and

814

A. Bin Mansoor et al.

propositions are not so neatly characterized. For example, concepts such as experience, tallness, richness, brightness etc cannot be represented by classical set theory. Fuzzy sets, in turn, are capable to represent imprecise concepts. In Fuzzy sets, the membership is a matter of a degree, i.e., degree of membership of an object in a fuzzy set expresses the degree of compatibility of the object with the concept represented by the fuzzy set. Each fuzzy set, A is defined in terms of a relevant universal set X by a membership function. Membership function assigns each element x of X a number, A(x), in the closed unit interval [0,1] that characterizes the degree of membership of x in A. In defining a membership function, the universal set X is always assumed to be a classical set.

3

Related Work in Fuzzy Image Processing

Fuzzy image processing has three main stages: image fuzzification, modification of membership values, and finally image defuzzification [18]. The fuzzification and defuzzification steps are due to unavailability of fuzzy hardware. The coding of image data (fuzzification) and decoding of the results (defuzzification) are steps that make possible to process images with fuzzy techniques. Rosenfeld [19] for the first time introduced fuzzy dilation and erosion and named them shrinking and expanding respectively. Later, Kaufmann and Gupta defined Minkowski addition of two fuzzy sets by means of the α-cuts [20]. They are considered as pioneers of fuzzy morphology. Today, there are many fuzzy constructions with various fuzzy operations available. In [21], Nachtegael et al. describe various usages of soft computing particularly fuzzy logic based applications. In [22], Popov applied various fuzzy morphological operators to colour images in YCrCb colour space utilizing centrally symmetric pyramidal structuring element. Ito and Avianto extracted tissue boundary from ultrasonogram using fuzzy morphology [23]. Maccarone et al. used fuzzy morphology to restore and retrieve structural properties of astronomical images [24]. Wirth and Ninkitenko presented a contrast enhancement algorithm based upon fuzzy morphology [25]. Großert et al. applied fuzzy morphology to detected infected regions of a leaf [26]. Strauss and Comby applied fuzzy morphology to omnidirectional catadioptric images [27]. Bloch and Saffiotti applied fuzzy morphology dealing with imprecise spatial information in autonomous robotics [28]. In our proposed scheme, we employed the alpha-cut morphology with a diamond shaped structuring element. We empirically optimized the structuring element by assigning alpha the value equal to complement of highest frequency intensity level in image histogram. Thus, modifying structuring mask weights for different images, it was possible to tune fuzzy morphological operations to image enhancement. α-cut Morphology. α-cut are used to easily connect fuzzy and crisp sets. Given a fuzzy set A(x), where x is an element of the universe of discourse X, and assigning membership degrees from the interval [0;1] to each element of X,

Fuzzy Morphology for Edge Detection and Segmentation

815

then for 0 < a < 1, the α-cut of A(x) is the set of all x ∈ X with membership degree at least as large as α : Aα = {x|A(x) ≥ α}

(5)

The union of two fuzzy sets A(x) and B(x) can be defined in terms of α-cut as: (A ∪ B)α = Aα ∪ Bα

(6)

The definition of Minkowski addition of two sets A and B requires the translate τa (X) of a (crisp) set X by a vector a, given as τa (X) = { y|y = x − a, x  X}

(7)

Then, the normal Minkowski addition and subtraction are defined as [17]: A (+) B = { a ∈ A | τa (B) ∩ A = φ}

(8)

m

A (−) B = { a ∈ A | τa (B) ⊆ A}

(9)

m

Kuafmann and Gupta extended it to fuzzy sets by applying α-cut on both sets, performing Minkowski operations and recombining them. Thus, the Minkowski addition and subtraction of two fuzzy sets are defined as: [A(x) (+) B(x)]α (x) = Aα (x) (+) Bα (x) m

(10)

m

[A(x) (−) B(x)]α (x) = Aα (x) (−) Bα (x) m

(11)

m

These equations are similar to mathematical morphological dilation and erosion, and are taken as the definition of fuzzy dilation and fuzzy erosion.

4

Proposed Fuzzy Morphological Filtering

Initially, a Top-hat tansformation is applied on the input image using fuzzy dilation and erosion. Top-hat transformation of an image is defined as h = B − (B ◦ M )

(12)

where B is the input image and M is the structuring element. The transform result in enhancing details, and is useful even in the presence of shading in the image. We used an adaptive diamond shaped structuring element of radius 11 by calculating the super minima. The fuzzification process of structuring element was done through α-cuts. We empirically found out that for structuring element the alpha chosen as complement of highest frequency in image histogram is the most appropriate choice. After completing the top-hat filtering the gray scale image was converted into binary by selecting the optimum threshold level using Otsu method [29]. We employed thinning by hit-or-miss transform for

816

A. Bin Mansoor et al.

shape detection. Hit or miss transform is a basic morphological tool for shape detection. The hit-or-miss transformation of A by B is denoted A ⊗ B. Here, B is a structuring element pair, B = (B1 , B2 ), rather than single element. The hit-or-miss transform is defined in terms of these two structuring elements as A ⊗ B = (A  B1 ) ∩ (Ac  B2 )

(13)

where Ac is the complement of A. The transform has its particular name because the output image consists of all locations that match the pixels in B1 (a hit), and that have none of the pixels in B2 (a miss). The thinned set is converted to m-connectivity to eliminate multiple paths, and only connected pixels are kept. The approach is adaptive by varying the desired quantity of connected pixels depending upon the ratio of the image and desired object. The resultant image is overlayed on the original image offering enhanced boundaries of the objects.

5

Experimental Results

For testing the proposed scheme, we chose images from various diverse areas like aerial images, sign boards and biological organisms. Fig. 1-a shows an aerial image of a runway. Image was processed with the proposed fuzzy morphology scheme and resulted in the connected edge map as shown in Fig. 1-b. In Fig. 1-c, the detected edges are overlaid on the original input image to show the enhanced image. We can see that the runway is accurately identified and unwanted edges are not detected. In Fig. 2, the proposed approach is applied to an image containing a sign board. The alphabets are correctly segmented by the proposed fuzzy morphology scheme. However, some unavoidable boundaries are also detected. Fig. 3-a shows an input image of a cell. The external shape and some internal details of the cell have correctly been detected using fuzzy morphology (see Fig. 3-b and c). To compare the performance of the proposed fuzzy morphology based filtering, we compared our results to some of the well known existing filters namely, unsharp masking (Fig. 1-d, Fig. 2-d and Fig. 3-d), Sobel (Fig. 1-e, Fig. 2-e and Fig. 3-e), and Laplacian ((Fig. 1-f, Fig. 2-f and Fig. 3-f). In all the three cases, we can see that our proposed fuzzy morphology based filter outperforms the existing filters by detecting more meaningful features in the input images.

6

Conclusion

We presented an adaptive image segmentation technique utilising alpha-cut fuzzy morphology approach to edge detection, image enhancement and segmentation. Better results were achieved than various existing enhancement approaches like unsharp masking, sobel and laplacian filtering. The proposed approach can be applied in various applications related to objects identification, geographical surveys, character recognition etc. In future work, we plan to investigate quantitative measures calculating the value of alpha.

Fuzzy Morphology for Edge Detection and Segmentation

(a)

(b)

(c)

(d)

(e)

(f)

817

Fig. 1. (a) Input image of an aerial view of a runway. (b) Connected edges found using fuzzy morphology. (c) Edges overlaid on input image for enhancement. (d) Applying unsharp filter. (e) Applying Sobel filter. (f) Applying Laplacian filter.

818

A. Bin Mansoor et al.

(a)

(b)

(c)

(d)

(e)

(f)

Fig. 2. (a) Input image of a sign board. (b) Connected edges (alphabets) detected using fuzzy morphology. (c) Edges overlaid on the input image for enhancement. (d) Applying unsharp filter. (e) Applying Sobel filter. (f) Applying Laplacian filter.

Fuzzy Morphology for Edge Detection and Segmentation

(a)

(b)

(c)

(d)

(e)

(f )

819

Fig. 3. (a) Input Image Of a Cell. (b) Connected Edges Detected Using Fuzzy Morphology. (c) Edges Overlaid On Original Image For Enhancement. (d) Applying Unsharp Filter. (e) Applying Sobel Filter. (f) Applying Laplacian Filter.

820

A. Bin Mansoor et al.

References 1. Gonzalez, W.: Digital Image Processing, 2nd edn. Prentice Hall, Englewood Cliffs (2002) 2. Liu, H.C., Srinath, M.D.: Partial shape classification using contour matching in distance transformation. IEEE Transactions on Pattern Analysis and Machine Intelligence 12, 1072–10791 (1990) 3. Marr, D., Hildreth, E.: Theory of edge detection. Proc. R. Soc. Lond. 207, 187–217 (1980) 4. Brown, L.G.: A survey of image registeration techniques. ACM Computing Surveys 24, 352–376 (1992) 5. Hoff, W., Ahuja, N.: Surface from stereo: Integrating feature matching, disparity estimation, and contoure detection. IEEE Transactions on Pattern Analysis and Machine Intelligence 11, 121–136 (1989) 6. Lengagne, R.P.F., Monga, O.: Using crest lines to guide sufrace reconstructin from stereo. In: IEEE International Conference on Pattern Recognition (1996) 7. Matheron, G.: Random Sets and Integral Geometry. Wiley, New York (1975) 8. Serra, J.: Image Analysis and Mathematical Morphology. Academic Press, London (1982) 9. Rosenfeld, A., Kak, A.C.: Digital Picture Processing. Academic Press, Boston (1982) 10. Preston, D.: Modern Cellular Automata. Plenum Press, New York (1984) 11. Maragos, P., Schafer, R.W.: Morphological filters. par i: Their set-theoretic analysis and relations to linear shift-invariant filters. part ii their relations to median, orderstatistic, and stack filters. IEEE Transactions on Pattern Analysis and Machine Intelligence (1987) 12. Maragos, P., Schafer, R.W.: Morphological systems for mulitdimensional signal processing. In: Trew, R.J. (ed.) Proc. of IEEE, pp. 690–710 (1990) 13. Heijmans, H.: Morphological Image Operators. Academic Press, Boston (1994) 14. Serra: Image Analysis and Mathematical Morphology. Academic Press, Boston (1988) 15. Bovik, A.: Morphological filtering for image enhancement and feature detection. In: Bovik, A. (ed.) Handbook of image and video processing, pp. 135–156 (2005) 16. Bloch, I., Maitre, H.: Fuzzy mathematical morphologies: A comparative study. Pattern Recognition (1995) 17. Soille: Morphological Image Analysis: Principles and Applications. Springer, Berlin (1999) 18. Tizhoosh: Fuzzy Image Processing. Springer, Berlin (1997) 19. Rosenfeld: The fuzzy geometry of image subsets. Pattern Recognition Letters (1984) 20. Kaufmann, G.: Fuzzy Mathematical Models in Engineering and Mangement Science. Elsevier Science Inc. New York (1988) 21. Nachtegael, Van der Weken, Van De Ville, Kerre (eds.): Fuzzy Filters for Image Processing. Studies in Fuzziness and Soft Computing, vol. 1. Springer, Heidelberg (2004) 22. Popov: Fuzzy mathematical morphology and its applications to colour image processing. W S C G (2007) 23. Ito, A.: Tissue boundary extraction from ultrasonogram by fuzzy morphology processing. In: 20th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, vol. 20, IEEE, Los Alamitos (1998)

Fuzzy Morphology for Edge Detection and Segmentation

821

24. Maccarone, T., Gesu: Fuzzy mathematical morphology to analyse astronomical images. In: International Conference on Pattern Recognition. (1992) 25. Wirth, N.: Applications of fuzzy morphology to contrast enhancement. In: Annual Meeting of the N. American Fuzzy Information Processing Society (2005) 26. Großert, K¨ oppen, N.: A new approach to fuzzy morphology based on fuzzy integral and its application in image processing. In: ICPR 1996, vol. 2, pp. 625–630 (2005) 27. Strauss, C.: Fuzzy morphology for omnidirectional images. In: IEEE International Conference on Image Processing, vol. 2, pp. 141–144. IEEE, Los Alamitos (2005) 28. Bloch, S.: Why robots should use fuzzy mathematical morphology. In: 1st Int. ICSC-NAISO Congress on Neuro-Fuzzy Technologies (2002) 29. Otsu, N.: A threshold selection method from gray-level histogram. IEEE Transactin on Systems, Man and Cybernetics (1979)