Digital Image Processing, Spring ECES 682 Digital Image Processing Week 8 Oleh Tretiak ECE Department Drexel University
Digital Image Processing, Spring Announcements Final exam on Monday, June 12 No class on May 29
Digital Image Processing, Spring Nonlinear Filtering g(x,y) = F[f(N(x,y))] N - neighborhood 3x3 neighborhood, binary images -> 512 different transformations Mystified by Wolfram (cellular automata) Some simple functions obviously useful Get rid of salt, pepper noise Detect edges
Digital Image Processing, Spring Morphological Image Processing Boolean algebra Dilation and erosion Opening and closing Hit-or-miss Basic algorithms Extension to gray-scale
Digital Image Processing, Spring Review: Boolean Algebra A Boolean algebra is a set with at least two elements, three operations (and , or , not ‘) and two special elements (0, 1) that have the following properties. AB is an element of the set. This function is defined for all elements A and B in the set. It is symmetric (AB = BA) A B has the same properties A’ is defined for all elements in the set. AA’=0, AA’=1 The operations and + are distributive. A(BC)=(AB)(AC) A(BC)=(AB)(AC) 0 and 1 are identities, in the following sense 0A=A 1A=A
Digital Image Processing, Spring Examples of Boolean Algebra Switching algebra S = {0, 1} Finite Boolean algebras Example: S = {(0, 0), (0, 1), (1, 0), (1, 1)} (a 1, a 2 )’ = (a’ 1, a’ 2 ) (0, 1)(1, 0) = (0, 0) Set unions/intersections Union is like Intersection is like Empty set is like 0 There is no 1 (universal set)
Digital Image Processing, Spring Boolean Algebra of Binary Pictures
Digital Image Processing, Spring Continuous and Discrete Morphology There are morphology theories of continuous and discrete spaces Example of continuous space Real line Example of discrete space Integers We will talk about the morphology of discrete spaces
Digital Image Processing, Spring Additional Operations Elements of set: points Points are integers (1-D discrete space) Points are 2-D vectors with integer components (2-D discrete space) Operations Addition (vector addition) Reflection (multiply by -1) Integer multiplication A set of points can be translated or reflected S+x = x+S (new set consists of all points of S, translated by x) S^ is the set reflected through the origin
Digital Image Processing, Spring Basic Morphological Operations Dilation A+B = {x| x = y+z, y in A, z in B} Equivalent definition {x, (x+B^)A is not empty} Erosion A-B = {x| x+B is a subset of A}
Digital Image Processing, Spring More Examples
Digital Image Processing, Spring
Digital Image Processing, Spring
Digital Image Processing, Spring Combination of Dilation and Contraction
Digital Image Processing, Spring Morphological Opening A opened by B
Digital Image Processing, Spring Morphological Closing A closed by B
Digital Image Processing, Spring Equations and Inequalities
Digital Image Processing, Spring Example
Digital Image Processing, Spring Combination of Opening and Closing
Digital Image Processing, Spring Hit-or-Miss Given: points on plane Template: Set of one points (foreground) and set of zero points (background) Example foreground: B 1 = D, B 2 = D Find: Points x for which B 1 +x are 1, B 2 +x are 0 Solution:
Digital Image Processing, Spring Example
Digital Image Processing, Spring Boundary Extraction
Digital Image Processing, Spring Region Filling Start with point in region A. Keep expanding by dilation, using points in region A only.
Digital Image Processing, Spring Extraction of Connected Components Start with point on object. Keep adding points
Digital Image Processing, Spring Skeleton Morphological skeleton Connected skeleton
Digital Image Processing, Spring Morphological Skeleton
Digital Image Processing, Spring Connected Skeleton
Digital Image Processing, Spring Morphological Skeleton Start with structuring element, B Generate a sequence of elements B k =kB, B 0 =0 Construction
Digital Image Processing, Spring Distance Function (Transform) Useful for morphology, skeletons, alignment MATLAB has a subfunction
Digital Image Processing, Spring Grey-Scale Morphology
Digital Image Processing, Spring Erosion
Digital Image Processing, Spring Example
Digital Image Processing, Spring Opening and Closing