Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology
Total Page:16
File Type:pdf, Size:1020Kb
Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Mathematical Morphology I The analysis of signals and images based on shape Mathematical Morphology: (Morphology = “study of shape”) Binary Morphology I Uses a set-theoretic approach to modify shapes based on local operators I Many operations are similar to convolution but use set CS 650: Computer Vision operations I Useful for I enhancing structural properties I segmentation I quantitative description Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Basic Operations Basic Operations Set Operations on Binary Images Translation A the image (“on” pixels) Ac the compliment of the image (inverse) I The image A translated by movement vector t is A B the union of images A and B ∪ = = + A B the intersection of images A and B At c c a t for some a A ∩ { | ∈ } A B = A Bc the difference between A and B − ∩ (the pixels in A that aren’t in B) I Literally, pick up each pixel in A and move it by the #A the cardinality of A (area of the object(s)) movement vector t Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Dilation Dilation Dilation Dilation I Everywhere the structuring element B overlaps the shape: A B = c c = a + b for some a A and b B ⊕ { | ∈ ∈ } I Unioned copies of the shifted image: A B = A ⊕ t t B [∈ I Unioned copies of the shifted B: A B = B ⊕ t t A [∈ Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Dilation Dilation Dilation Properties of Dilation I Commutative: A B = B A ⊕ ⊕ I Associative: (A B) C = A (B C)) ⊕ ⊕ ⊕ ⊕ Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Erosion Erosion Erosion Erosion I All the positions where the structuring element B fits entirely inside the shape: A B = x x + b A for every b B { | ∈ ∈ } I Intersected copies of the shifted image A B = A t − t B \∈ Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Erosion Erosion Erosion Properties of Erosion I Not commutative: ? A B = B A I Not associative: ? (A B) C = A (B C) Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Erosion Erosion Duality of Erosion and Dilation Example Application: Finding Boundary Pixels I Dual operations are ones that can be defined in terms of each other I Can find all of the boundary pixels by dilating the object and subtracting the original: I Duals are not inverse operations I Dilation and erosion are dual operations: Bound (A) = (A B) A ext ⊕ − c c ˘ (A B) = A B where B is a 3 3 structuring element containing all 1s ⊕ × (A B)c = Ac B˘ ⊕ I Or by eroding the original and subtracting that from the ˘ original: where B denotes the reflection of B Bound (A) = A (A B) int − I Intuition: dilating the foreground is the same as eroding the background—the structuring just element flips Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Erosion Hit-and-Miss Example Application: Finding Boundary Pixels Hit-and-Miss I Hit-and-miss operators find target pixel configurations: A (J, K ) = (A J) (Ac K ) ⊗ ∩ I J is the target that must be “hit” (foreground) I K is the target that must be “missed” (background) I Example: 0 0 0 0 1 1 x 0 0 1 1 0 0 0 1 1 1 0 → 0 1 0 0 0 0 x 1 x J K Effective Target Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Opening and Closing Opening and Closing Opening Closing I An opening operation is an erosion followed by a dilation: I A closing operation is a dilation followed by an erosion: A B = (A B) B A B = (A B) B ◦ ⊕ • ⊕ I Used to remove small objects, protrusions, connections I Used to remove small holes, gaps, etc. Mathematical Morphology: Binary Morphology Mathematical Morphology: Binary Morphology Opening and Closing Opening and Closing Duality of Opening and Closing Example: Opening and Closing for Noise Removal I Opening and closing are also duals: (A B)c = Ac B˘ ◦ • I Intuition: opening to remove small foreground objects is the same as closing small holes in the background Mathematical Morphology: Binary Morphology Opening and Closing Idempotence of Opening and Closing I An operation is idempotent if applying it once is as good as applying it many times I Opening and closing are idempotent (A B) B = A B ◦ ◦ ◦ (A B) B = A B • • •.