Introduction to Mathematical Morphology Erosions, Dilations, Openings, Closings
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to mathematical morphology Erosions, Dilations, Openings, Closings Samy Blusseau, Centre de Morphologie Mathématique November 2020 Mathematical morphology what for? 2 Applications Screening of diabetic retinopathy Image credit: Étienne Decencière, Mines ParisTech. 3 Applications Segmentation of lymphocytes in the blood Image credit: Étienne Decencière, Mines ParisTech. 4 Applications Semantization of point clouds Image credit: Andrés Serna and Beatriz Marcotegui, TERRA3D. 5 Applications Quality control of industrial materials Image credit: Copyright Philippe Stroppa, SAFRAN. 6 http://www.safran-medialibrary.com/Medialibrary/media/95545 Applications 7 Principles An image is an array of numbers, that is to say a function from a discrete grid to real numbers. Objects usually correspond to ”flat” regions of this function, and are delimited by their contours (extrema of the gradient). A grayscale image (above) and its morphological gradient (below) Illustration credit: Jean Serra, Mines ParisTech. 8 Principles An example of analysis: the Watershed algorithm. Idea: “flooding” the gradient image, seen as a topographic relief, starting from certain “springs” (for example the regional minima of the gradient.) Illustration credit: Beatriz Marcotegui, Mines ParisTech. 9 The variations of an image are more complex than it may seem! Principles In red: Maxima of the image (left) and minima of the gradient (right) 10 The variations of an image are more complex than it may seem! Principles Result of the watershed algorithm: oversegmentation 11 The variations of an image are more complex than it may seem! Principles Left: result of a morphological filter; Right: the new regional maxima. 12 The variations of an image are more complex than it may seem! Principles Segmentation after simplification of the image. 13 The variations of an image are more complex than it may seem! Principles Main idea: simplify images to keep only the relevant information. Segmentation after simplification of the image. 14 Some examples to get intuitions 15 16 Domain 17 Domain 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 “Dilation of X by the structuring element B” 40 “Dilation of X by the structuring element B” Property: 41 42 43 44 45 46 47 48 49 50 51 52 53 “Erosion of X by the structuring element B” Property: 54 “Dilation of X by the structuring element B” “Erosion of X by the structuring element B” 55 Links between and ? 56 57 58 59 60 Here: 61 Here: (In general: with ) 62 Links between and : Are they inverse of each other? 63 is not injective 64 is not injective 65 is not injective is not surjective 66 is not injective is not surjective 67 is not injective is not surjective 68 is not injective is not surjective 69 is not injective is not surjective 70 is not injective is not surjective 71 72 and are not invertible, however... 73 and are not invertible, however... 74 and are not invertible, however... 75 and are not invertible, however... 76 and are not invertible, however... Denoting Denoting Then, on Then, on 77 Quiz time! 78 1. The set X is the dilation of some Y by the structuring element B: A: True B: False C: I don’t know 79 1. The set X is the dilation of some Y by the structuring element B: A: True B: False C: I don’t know 2. The set X is the erosion of some Y by the structuring element B: A: True B: False C: I don’t know 80 3. The dilation of X by the structuring element B is: A: Y B: Z C: I don’t know 81 Generalization Theory of Complete Lattices 82 Definitions Partially ordered set Let be a set. A partial order on is a binary relation that satisfies Then is called a partially ordered set (or poset). Examples: , for any set . 83 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . The supremum and infimum of a subset are respectively noted and . By antisymmetry of the order, they are unique. In particular, has a supremum and an infimum, the largest and the smallest elements of the lattice. 84 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 1: for any set . For any family of subsets of , 85 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 2: 86 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 2: 87 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 2: 88 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 2: 89 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 2: 90 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 2: 91 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 3: where each is a complete lattice and Then 92 Definitions Complete lattice A complete lattice is a partially ordered set such that any subset of has a supremum and an infimum in . Example 4: For any complete lattice and any set , let be the set of functions from to and the order defined by Then is a complete lattice and 93 Definitions Dilation Let and be two complete lattices. A dilation from to is an operator that commutes with the supremum: 94 Definitions Dilation Let and be two complete lattices. A dilation from to is an operator that commutes with the supremum: Properties: 95 Definitions Dilation Let and be two complete lattices. A dilation from to is an operator that commutes with the supremum: Properties: (increasingness) 96 Definitions Dilation Let and be two complete lattices. A dilation from to is an operator that commutes with the supremum: Properties: (increasingness) (mapping least element to least element) 97 Definitions Erosion Let and be two complete lattices. An erosion from to is an operator that commutes with the infimum: Properties: (increasingness) (mapping largest element to largest element) 98 Definitions Opening Let be a complete lattice. An opening of is an operator that is increasing idempotent anti-extensive Important property: the supremum of openings is an opening. Denoting the set of openings of , 99 Definitions Closing Let be a complete lattice. A closing of is an operator that is increasing idempotent extensive Important property: the infimum of closings is a closing. Denoting the set of closings of , 100 Definitions Adjunction Let and be two complete lattices, and two operators. The couple is called and adjunction if and only if Properties of an adjunction : (1) is a dilation and is an erosion (4) and (2) (5) is a closing and is an opening. (3) 101 Definitions Adjunction Let and be two complete lattices, and two operators. The couple is called and adjunction if and only if Conversely: If is a dilation then is its unique adjoint erosion. If is an erosion then is its unique adjoint dilation. 102 Definitions Adjunction Let and be two complete lattices, and two operators. The couple is called and adjunction if and only if Geometrical interpretation of : Hence “Projection” of y on the image of 103 Definitions Adjunction Let and be two complete lattices, and two operators. The couple is called and adjunction if and only if Geometrical interpretation of : Hence “Projection” of x on the image of 104 Example of opening and closing 105 Example of opening 106 Example of closing 107 Definitions Duality Let be a complete lattice and an inversion: a bijection such that If is a dilation on , then is an erosion, called the dual erosion of for . If is an erosion on , then is a dilation, called the dual dilation of for . If is a closing on , then is an opening, called the dual opening of for . If is an opening on , then is a closing, called the dual closing of for . Example: A particular but very common case is when (involution): 108 Definitions Granulometry It is a decreasing family of openings , i.e. such that . A granulometry verifies the semi-group property Granulometries made of openings with increasing structuring elements are typically used to analyse the distribution of bright objects’ sizes in an image. 109 Definitions Anti-granulometry It is an increasing family of closings , i.e. such that . An anti-granulometry verifies the semi-group property Anti-granulometries made of closings with increasing structuring elements are typically used to analyse the distribution of dark objects’ sizes in an image. 110 Mathematical morphology on binary images 111 Support of the image Binary image It is a function from E to {0, 1}, that can be identified to a subset of E. 112 Structuring elements origin Symmetrical structuring elements, containing or not the origin. Asymmetrical structuring elements and their symmetric versions 113 Structuring elements origin Symmetrical structuring elements, containing or not the origin. Asymmetrical structuring elements and their symmetric versions. 114 Dilation by the structuring element B 115 Dilation by the structuring element B Minkowski addition 116 117 118 119 120 121 122 123 Dilation by a structuring element B 124 125 126 Erosion by a structuring element B where 127 128 129 130 Erosion by a structuring element B 131 132 133 Duality and are dual for the set complementation: Adjunction is an adjunction.