1.22k likes | 1.27k Vues
Binary Morphology. Morphology. Morphology generally concerned with shape and properties of objects. Used for segmentation and feature extraction. Segmentation = used for cleaning binary objects. Two basic operations erosion (opening) dilation (closing). Morphological operations and algebras.
E N D
Morphology • Morphology generally concerned with shape and properties of objects. Used for segmentation and feature extraction. • Segmentation = used for cleaning binary objects. • Two basic operations • erosion (opening) • dilation (closing)
Morphological operations and algebras • Different definitions in the textbooks • Different implementations in the image processing programs. • The original definition, based on set theory, is made by J. Serra in 1982. • Defined for binary images - binary operations (boolean, set-theoretical) • Can be used on grayscale images - multiple-valued logic operations
Morphological operations on a PC • Various but slightly different implementations in • Scion • Paint Shop Pro • Adope Photoshop • Corel Photopaint • mm Try them, it is a lot of fun
Morphological operations in Scion • Rank filtering (Grayscale) • Binary operations • based on 3x3 neighborhood • based on EDM (Euclidean Distance Map) • Applications • Noise reduction • Segmentation • Edge detection
In general; what is “Morphology”? The science of form and structure the science of form, that of the outer form, inner structure, and development of living organisms and their parts about changing/counting regions/shapes Among other applications it is used to pre- or post-process images via filtering, thinning and pruning Count regions (granules) number of black regions Estimate size of regions area calculations • Smooth region edges • create line drawing of face • Force shapes onto region edges • curve into a square
Mathematical Morphology - Set-theoretic representation for binary shapes
Binary Morphology • Morphological operators are used to prepare binary (thresholded) images for object segmentation/recognition • Binary images often suffer from noise (specifically salt-and-pepper noise) • Binary regions also suffer from noise (isolated black pixels in a white region). Can also have cracks, picket fence occlusions, etc. • Dilation and erosion are two binary morphological operations that can assist with these problems.
Goals of morphological operations: • 1. Simplifies image data • 2. Preserves essential shape characteristics • 3. Eliminates noise • 4. Permits the underlying shape to be identified and optimally reconstructed from their distorted, noisy forms
What is the mathematical morphology ? • 1. An approach for processing digital image based on its shape • 2. A mathematical tool for investigating geometric structure in image • The language of morphology is set theory. Mathematical morphology is extension to set theory.
Importance of Shape in Processing and Analysis • Shape is a prime carrier of information in machine vision • For instance, the following directly correlate with shape: • identification of objects • object features • assembly defects
Shape Operators • Set Union (overlapping objects): • Shapes are usually combined by means of : • Set Difference based on Set intersection (occluded objects): Set difference Set intersection
Morphological Operations • The primary morphological operations are dilationanderosion • More complicated morphological operators can be designed by means of combining erosions and dilations We will use combinations of union, complement, intersection, erosion, dilation, translation... Let us illustrate them and explain how to combine
Dilation (Minkowski addition) • Erosion shrinks • Dilation expands binary regions • Can be used to fill in gaps or cracks in binary images structuring Element ( SE ) • If the point at the origin of the structuring element is set in the underlying image, then all the points that are set in the SE are also set in the image • Basically, its like OR’ing the SE into the image
Dilation • Fills in holes. • Smoothes object boundaries. • Adds an extra outer ring of pixels onto object boundary, ie, object becomes slightly larger.
Morphology • Erosion and dilation clean image but leave objects either smaller or larger than their original size. • Opening and closing perform same functions as erosion and dilation but object size remains the same.
More Erode and Dilate Examples Input Image Dilated Eroded Made in Paint Shop Pro
Dilation explained pixed by pixel • • • • • • • • • • • • • • • • Denotes origin of B i.e. its (0,0) Denotes origin of A i.e. its (0,0) B A
Dilation explained by shape of A • • • • • • • • • • • • • • • • Shape of A repeated without shift B Shape of A repeated with shift A
Properties of Dilation 1. fills in valleys between spiky regions 2. increases geometrical area of object 3. sets background pixels adjacent to object's contour to object's value 4. smoothes small negative grey level regions objects are light (white in binary) Dilation does the following:
Structuring Element for Dilation Length 6 Length 5
Structuring Element for Dilation Single point in Image replaced with this in the Result
Definition of Dilation: Mathematically • Dilation is the operation that combines two sets using vector addition of set elements. • Let A and B are subsets in 2-D space. A: image undergoing analysis, B: Structuring element, denotes dilation
Mathematics: Dilation versus translation • Let A be a Subset of and . • The translation of A by x is defined as • The dilation of A by B can be computed as the union of translation of A by the elements of B x is a vector
Dilation versus translation, illustrated • • • • • • • • • • • • • • • • • • • • • Element (0,0) Shift vector (0,1) Shift vector (0,0) B
Mathematics of Dilation: using Union Formula Center of the circle This circle will create one point This circle will create no point
Example of Dilation with various sizes of structuring elements Structuring Element Pablo Picasso, Pass with the Cape, 1960
Mathematical Properties of Dilation • Commutative • Associative • Extensivity • Dilation is increasing Illustrated in next slide
Illustration of Extensitivity of Dilation • • • • • • • • • • • • • • By 0 or O we denote the origin point A B Replaced with Here 0 does not belong to B and A is not included in A B
More Properties of Dilation • Translation Invariance • Linearity • Containment • Decomposition of structuring element
More Formalisms for Dilation • The dilation operator takes two pieces of data as input • A binary image, which is to be dilated • A structuring element (or kernel), which determines the behavior of the morphological operation • Suppose that X is the set of Euclidean coordinates of the input image, and K is the set of coordinates of the structuring element • Let Kxdenote the translation of K so that its origin is at x. • The DILATION of X by K is simply the set of all points x such that the intersection of Kx with X is non-empty
Example of Dilation with SE that has an origin in its center 1 1 1 1 1 1 1 1 1 Example: Suppose that the structuring element is a 3x3 square with the origin at its center { (-1,-1), (0,-1), (1,-1), (-1,0), (0,0), (1,0), ( 1,1), (0,1), (1,1) } K = X =
Dilation Example continued Note: Foreground pixels are represented by a color and background pixels are empty
Steo-by-step explanation of Dilation Overlap of green and red Structuring element Input Explanation of processing First row processing output
Dilation Second row processing output
Dilation Third row processing output Fourth row processing nothing
Another example of Dilation that can be analyzed step-by-step by students
Why we analyze Morphology mathematically? Useful when you want to write efficient software Very useful when you want to design a special purpose hardware computer for image processing using FPGAs. Useful when you want to prove something mathematically about images – this is an area of pure mathematics Useful when you want to create new morphological operators. Useful when you want to extend to complex numbers, quaternions, octonions, gray level and color images.
Erosion • (Minkowski subtraction) • The contraction of a binary region (aka, region shrinking) • Use a structuring element on binary image data to produce a new binary image • Structuring elements (SE) are simply patterns that are matched in the image • It is useful to explain operation of erosion and dilation in different ways.
Intuition for Erosion • Removes isolated noisy pixels. • Smoothes object boundary. • Removes the outer layer of object pixels, ie, object becomes slightly smaller.
Properties of Erosion: Erosion removes spiky edges objects are light (white in binary) decreases geometrical area of object sets contour pixels of object to background value smoothes small positive grey level regions
Erosion explained pixel by pixel • • • • • • • • • • • • • • When whole SE included, origin point copied to new image B A