Machine vision. Summary # 5: Morphological operations

Similar documents
Introduction. Computer Vision & Digital Image Processing. Preview. Basic Concepts from Set Theory

Morphological Image Processing

morphology on binary images

What will we learn? What is mathematical morphology? What is mathematical morphology? Fundamental concepts and operations

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

Morphological Image Processing

Biomedical Image Analysis. Mathematical Morphology

Morphological Image Processing

Mathematical Morphology and Distance Transforms. Robin Strand

ECEN 447 Digital Image Processing

EE795: Computer Vision and Intelligent Systems

Morphological Image Processing

Morphological Image Processing

Morphological Image Processing

Digital Image Processing COSC 6380/4393

Processing of binary images

Lecture 7: Morphological Image Processing

EECS490: Digital Image Processing. Lecture #17

Chapter 9 Morphological Image Processing

Image Analysis. Morphological Image Analysis

Morphological Compound Operations-Opening and CLosing

Mathematical morphology (1)

International Journal of Advance Engineering and Research Development. Applications of Set Theory in Digital Image Processing

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Topic 6 Representation and Description

EE 584 MACHINE VISION

Filters. Advanced and Special Topics: Filters. Filters

Binary Shape Characterization using Morphological Boundary Class Distribution Functions

PPKE-ITK. Lecture

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

CITS 4402 Computer Vision

Detection of Edges Using Mathematical Morphological Operators

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

Morphological Image Processing GUI using MATLAB

Digital Image Processing Fundamentals

Mathematical morphology... M.1 Introduction... M.1 Dilation... M.3 Erosion... M.3 Closing... M.4 Opening... M.5 Summary... M.6

11/10/2011 small set, B, to probe the image under study for each SE, define origo & pixels in SE

Binary Image Analysis. Binary Image Analysis. What kinds of operations? Results of analysis. Useful Operations. Example: red blood cell image

ECG782: Multidimensional Digital Signal Processing

11. Gray-Scale Morphology. Computer Engineering, i Sejong University. Dongil Han

Disease Prediction of Paddy Crops Using Data Mining and Image Processing Techniques

ECG782: Multidimensional Digital Signal Processing

CS443: Digital Imaging and Multimedia Binary Image Analysis. Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University

Lab 2. Hanz Cuevas Velásquez, Bob Fisher Advanced Vision School of Informatics, University of Edinburgh Week 3, 2018

[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

BSc (Hons) Computer Science. with Network Security. Examinations for / Semester 2

Robot vision review. Martin Jagersand

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Morphological Image Processing

Binary Morphological Model in Refining Local Fitting Active Contour in Segmenting Weak/Missing Edges

Lecture 2 Image Processing and Filtering

Digital image processing

Binary Image Processing. Introduction to Computer Vision CSE 152 Lecture 5

N.Priya. Keywords Compass mask, Threshold, Morphological Operators, Statistical Measures, Text extraction

SECTION 5 IMAGE PROCESSING 2

Erosion, dilation and related operators

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

From Pixels to Blobs

Computer Vision I - Basics of Image Processing Part 1

HCR Using K-Means Clustering Algorithm

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

Image Processing: Final Exam November 10, :30 10:30

Review for the Final

Chapter 11 Representation & Description

Edges and Binary Image Analysis April 12 th, 2018

OBJECT detection in general has many applications

ECE 172A: Introduction to Intelligent Systems: Machine Vision, Fall Midterm Examination

Digital Image Processing

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

Cartoon Transformation

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Examination in Image Processing

Image Processing. Filtering. Slide 1

Digital Image Processing. Image Enhancement in the Frequency Domain

EECS490: Digital Image Processing. Lecture #23

Morphology-form and structure. Who am I? structuring element (SE) Today s lecture. Morphological Transformation. Mathematical Morphology

JNTUWORLD. 4. Prove that the average value of laplacian of the equation 2 h = ((r2 σ 2 )/σ 4 ))exp( r 2 /2σ 2 ) is zero. [16]

Extraction and Recognition of Alphanumeric Characters from Vehicle Number Plate

Basic relations between pixels (Chapter 2)

Image Processing (IP) Through Erosion and Dilation Methods

Albert M. Vossepoel. Center for Image Processing

Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

Introduction to Medical Imaging (5XSA0)

Edges and Binary Images

COMPUTER AND ROBOT VISION

web Thank you for choosing a Meliconi remote control.

Interpolation is a basic tool used extensively in tasks such as zooming, shrinking, rotating, and geometric corrections.

Digital Image Processing COSC 6380/4393

Two Image-Template Operations for Binary Image Processing. Hongchi Shi. Department of Computer Engineering and Computer Science

Chapter 3. Image Processing Methods. (c) 2008 Prof. Dr. Michael M. Richter, Universität Kaiserslautern

What will we learn? Neighborhood processing. Convolution and correlation. Neighborhood processing. Chapter 10 Neighborhood Processing

Lecture 4: Spatial Domain Transformations

CS 5540 Spring 2013 Assignment 3, v1.0 Due: Apr. 24th 11:59PM

UNIT-2 IMAGE REPRESENTATION IMAGE REPRESENTATION IMAGE SENSORS IMAGE SENSORS- FLEX CIRCUIT ASSEMBLY

Image Processing Fundamentals. Nicolas Vazquez Principal Software Engineer National Instruments

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

Fundamentals of Digital Image Processing

9.913 Pattern Recognition for Vision. Class 8-2 An Application of Clustering. Bernd Heisele

Connected components - 1

Transcription:

1 Machine vision Summary # 5: Mphological operations MORPHOLOGICAL OPERATIONS A real image has continuous intensity. It is quantized to obtain a digital image with a given number of gray levels. Different numbers such as 256 (most common) 512 are used. Higher numbers such as 4096 are used in me sensitive applications (medical imaging f example). In the early days of machine vision, stage memy computer power were very limited expensive. F this reason, design focused on binary images (two levels of gray). Although computer memy speed have improved considerably, binary images are still widely used in various applications. Applications of binary images: Chromosome analysis Optical character recognition Industrial parts recognition Advantages of binary images Smaller memy requirements Faster execution time Can be used in many applications Limitations Cannot be extended to 3D Losing intensity details (infmation). A. Thresholding operations Thresholding allows to obtain a binary image from a gray level image. Thresholding can be expressed as follows { 1 if f(i, j) < T A(i, j) = (1) { 1 if f(i, j) Z A(i, j) = where Z is a set of intensity levels f a given object. Matlab comm im2bw allows to obtain a binary image from a gray level image. Mphological operations are operations on binary images. They affect the shape structure of the object. Definition: Mphological operations: analysis processing of geometric structure. Mathematical mphology is mainly applied to digital images but it has other applications as well. Mathematical mphology was initially developed f binary images, later, it was extended to gray level images. It was introduced in 1964 by Martheron Serra, from Ecole des Mines de Paris. B. Basic concepts from set they 1) a is an element of A: a A 2) a is not an element of A: a A 3) A is a subset of B: A B 4) C is the union of A B: C = A B (2) 5) Union: A B = {p/p A p B} 6) C is the intersection of A B: C = A B 7) Intersection: A B = {p/p A p B} 8) Complement: Ω = {p/p Ω p A}. In a binary image this cresponds to interchanging 0s 1s. There are two basic mphological operations: dilation erosion. Dilation erosion are perfmed by laying the structuring element B on the image A, sliding it cross the image. Notations Black pixel: value 0. White pixel: value 1. The structuring element B is similar to a mask a filter. B can have any shape, typical shapes include: row(3), column(3), cross(3). Matlab function strel can be used to create the structuring element. The size shape of the structuring element are imptant facts that affect the output image cannot be neglected igned. C. Dilation Dilation can be defined as follows A B = {c/c = a + b, a A, b B} (3) where A is the image B is the structuring element. This operation has some similarities with the Minkowski sum. D. Dilation example The result of dilation is A = 1 0 1 0 1 1 0 1 1 (4) B = [ 1 0 1 ] (5) C = (6) Note the the result of convolution will be C = 0 2 0 (7) Thus, in mphological operations 1+1=1. E. Erosion Erosion is the dual of dilation. It is given by C = A B = {C/B c A} (8)

where B c is a shift by c units. The structuring element B is positioned with its igin at pixel (i, j) the new pixel value is determined using the rule { 1 if B fits in A C(i, j) = (9) Another way to write erosion is as follows C = A B = {x : B x A} (10) Therefe, C consists of all points x f which the translation of B by x fits inside A. F. Some properties of erosion dilation Dilation: is commutative Dilation is associative A B = B A (11) A (B C) = (A B) C (12) Erosion is not commutative G. Example of erosion dilation With Image A is given by Erosion: Dilation: A B B A (13) A = [ 1 0 0 0 0 1 1 ] (14) B = [ ] (15) C = [ 0 0 0 0 0 0 0 ] (16) C = [ 1 1 0 1 ] (17) H. Rules f padding images Processing pixels at image bder is done as follows: 1) Dilation: Pixels beyond the image bder are assigned minimum value, that is zero. 2) Erosion: Pixels beyond the image bder are assigned maximum value, that is 1 255 (in gray level). The structuring element can be of any size shape, but usually it is much smaller than the image, The structuring element is binary has a well defined igin (center). In general B is a 3 by 3 mask it is applied to every pixel in the image. I. Examples of structuring element The most common structuring elements can be divided into four groups: 1) SE of Type I (18) 2) SE of Type II: (19) 3) SE of Type III, B k, k = 1, 2,..., 4, (rotate 90 o ): 1 X X 1 0 X (20) 1 X X 4) SE of Type IV, B k, k = 1, 2,..., 8, (rotate 45 o ): 0 0 0 X 1 X (21) where X means don t care J. Effects of dilation erosion Dilation exps the white erosion shrinks the white. 1) Dilation can be used to exp object fill in holes connect disjoint objects 2) Erosion can be used to shrink object Dilation erosion are the most basic mphological operations. Assuming the background is black (0) the object is white (1), dilation exps the object, fills in holes, repairs breaks; erosion shrinks objects, splits apart joined objects, strips away extrusions. Erosion dilation are illustrated in figure 2. Both dilation erosion use a structuring element. Other mphological operations can be derived based on combinations of dilation erosion. K. Example F image A in figure 3, apply the following: 1) Dilation then erosion, 2) Erosion then dilation. The results are shown in figure 3. It is clear that Dilation(erosion(A)) A Erosion(dilation(A)) A Dilation(erosion(A)) Erosion(dilation(A)) Clearly, erosion dilation are not the inverse of each other, they do not cancel out. They are the dual of each other. Other definitions f erosion dilation: Dilation: A B = A b (22) b B where A b is a translation of A by b units. Erosion: A B = A b (23) b B where A b is a translation of A by b units. A b is the reverse translation of A b. 2

Fig. 1. (a) Original image, (b) structuring element (strel( diamond, 6), (c) after erosion, (d) after dilation a b A erode(dilate(a, B), B) c dilate(erode(a, B), B) B Fig. 2. (a) Original image, (b) after dilation (c) after erosion. The structuring element is given by B = strel( diamond,4) Fig. 3. Comparison between erosion dilation applied in different ders L. Example Relationship between dilation erosion can be written as A B = (A c B s ) c (24) where B s is the symmetric of B. In der to illustrate equation (24), we consider image A given by: A = 1 0 0 1 (25) 0 0 B = [ 1 0 1 ] (26) 3

In this case, the compliment of A is A c = 1 1 1 0 0 0 0 (27) 1 0 0 0 1 The symmetric of the structuring element is given by B s = [ 1 0 1 ] (28) (a) (b) finally A c B s = (A c B s ) c = 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 (29) (30) which is the same as A B. Dilation erosion are the most basic mphological operations. Other operations can be derived based on these operations M. Opening closing These are mphological operations derived from dilation erosion. Opening: Erosion followed by dilation using the same structuring element: open(a, B) = dilate [erode(a, B), B] (31) A B = (A B) B (32) Closing: Dilation followed by erosion using the same structuring element: close(a, B) = erode [dilate(a, B), B] (33) A B = (A B) B (34) Both closing opening use erosion dilation but in different ders. The der is imptant, it is what makes the difference. Opening closing are not opposite of each other, they are duals. They are related as follows where X s is the symmetric of X X c is the complement of X A B = (A c B s ) c (35) Closing: fills in holes small gaps, it can be used to remove noise. Opening: Remove small objects, can be used f template matching. (c) Fig. 4. Boundary detection. (a): iginal image, (b): using equation (39), (c): using equation (40), (d) using mphological gradient. The structuring element is given by B = strel( diamond,4) Both closing opening are idempotent, i.e., applying them multiple times does not change the result. (d) (A B) B = A B (36) (A B) B = A B (37) Opening closing satisfy the following Opening: A B A Closing: A A B N. Why opening closing? Erosion is used to remove little objects in the image but at the same time, after erosion the object is smaller. Applying dilation with the same structuring element leads to the iginal size of the objects. Dilation fills little holes, but it also enlarges the object. An erosion brings the object to the iginal size. O. Mphological gradient Mphological gradient acts in a similar way to the gradient, i.e., can be used to detect edges, i.e., boundaries in binary images. (A B) (A B) A = (38) diamb where B is a disk like mask with a small diameter: diam B. Other operats that can be used to extract boundaries are Method I (A B) A (39) Method II A (A B) (40) Boundary detection using mphological operations is ilsutrated in figure 4. Region filling Region filling can be accomplished by iteratively using dilation intersection. We begin by defining a point p = 1 4

The output image when the filter is applied to the center pixel with a 3 by 3 window is 1 0 1 A = 1 1 0 (45) Original After hit miss B 1 B 2 Fig. 5. (a) Original image, (b) after hit miss inside the hole, we perfm the following operation X k = (X k 1 B) A c (41) X 0 = p (42) where B is the cross structuring element. The algithm exits when X k = X k 1. Hit miss transfmation (hit miss) Hit miss is a method f template matching. It can be used to find the location of one shape among a set of shapes. Uses two structuring elements B 1, B 2, with B 1 B 2 = 0. The hit miss operation is A B = (A B 1 ) (A c B 2 ) (43) where B = (B 1, B 2 ). Hit miss is the intersection of two erosions, it uses a pair of positive negative template. The result is 1 when B 1 fits in A B 2 misses A (fits in A c ). The output is one A has all pixels in B 1 but none in B 2. Hit miss filter is widely used binary pattern recognition. An illustration of using hit miss to find a cross in A is shown in figure 5. Majity filter A majity filter is a special case of the median filter. In a similar way to the median filter, the majity filter is very efficient in removing salt pepper noise. An example is below: Original image: A = 1 0 1 1 0 0 (44) 5