Morphological Image Processing

Similar documents
Structuring Element Representation of an Image and Its Applications

Mathematical Description of Discrete-Time Signals. 9/10/16 M. J. Roberts - All Rights Reserved 1

Discrete-Time Systems, LTI Systems, and Discrete-Time Convolution

Linear time invariant systems

Image pyramid example

Lecture 2 Linear and Time Invariant Systems

Scale-space image processing

Lecture 3. Digital Signal Processing. Chapter 3. z-transforms. Mikael Swartling Nedelko Grbic Bengt Mandersson. rev. 2016

Practical Spectral Anaysis (continue) (from Boaz Porat s book) Frequency Measurement

x[0] x[1] x[2] Figure 2.1 Graphical representation of a discrete-time signal.

The z-transform. 7.1 Introduction. 7.2 The z-transform Derivation of the z-transform: x[n] = z n LTI system, h[n] z = re j

Template matching. s[x,y] t[x,y] Problem: locate an object, described by a template t[x,y], in the image s[x,y] Example

Signal Processing in Mechatronics. Lecture 3, Convolution, Fourier Series and Fourier Transform

Question1 Multiple choices (circle the most appropriate one):

Signals & Systems Chapter3

Discrete-Time Signals and Systems. Signals and Systems. Digital Signals. Discrete-Time Signals. Operations on Sequences: Basic Operations

Chapter 7 z-transform

FFTs in Graphics and Vision. The Fast Fourier Transform

EEO 401 Digital Signal Processing Prof. Mark Fowler

ELEG 4603/5173L Digital Signal Processing Ch. 1 Discrete-Time Signals and Systems

ELEG3503 Introduction to Digital Signal Processing

Lesson 10: Limits and Continuity

Chapter 7: The z-transform. Chih-Wei Liu

2D DSP Basics: 2D Systems

Olli Simula T / Chapter 1 3. Olli Simula T / Chapter 1 5

The Z-Transform. (t-t 0 ) Figure 1: Simplified graph of an impulse function. For an impulse, it can be shown that (1)

Filter banks. Separately, the lowpass and highpass filters are not invertible. removes the highest frequency 1/ 2and

Finite-length Discrete Transforms. Chapter 5, Sections

6.003 Homework #3 Solutions

Analog and Digital Signals. Introduction to Digital Signal Processing. Discrete-time Sinusoids. Analog and Digital Signals

B = B is a 3 4 matrix; b 32 = 3 and b 2 4 = 3. Scalar Multiplication

Web Appendix O - Derivations of the Properties of the z Transform

Chapter 8. DFT : The Discrete Fourier Transform

CEE 522 Autumn Uncertainty Concepts for Geotechnical Engineering

ELEC1200: A System View of Communications: from Signals to Packets Lecture 3

APPENDIX F Complex Numbers

The Discrete Fourier Transform

Solutions. Number of Problems: 4. None. Use only the prepared sheets for your solutions. Additional paper is available from the supervisors.

Time-Domain Representations of LTI Systems

Frequency Response of FIR Filters

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

CHAPTER I: Vector Spaces

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense,

Median and IQR The median is the value which divides the ordered data values in half.

Discrete-Time Signals and Systems. Discrete-Time Signals and Systems. Signal Symmetry. Elementary Discrete-Time Signals.

TEACHER CERTIFICATION STUDY GUIDE

GEORGIA INSTITUTE OF TECHNOLOGY SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING

EECS564 Estimation, Filtering, and Detection Hwk 2 Solns. Winter p θ (z) = (2θz + 1 θ), 0 z 1

Z - Transform. It offers the techniques for digital filter design and frequency analysis of digital signals.

CALCULUS BASIC SUMMER REVIEW

ADVANCED DIGITAL SIGNAL PROCESSING

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE

EE / EEE SAMPLE STUDY MATERIAL. GATE, IES & PSUs Signal System. Electrical Engineering. Postal Correspondence Course


Digital signal processing: Lecture 5. z-transformation - I. Produced by Qiangfu Zhao (Since 1995), All rights reserved

Statistical Noise Models and Diagnostics

Optimum LMSE Discrete Transform

It is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function.

CS / MCS 401 Homework 3 grader solutions

Wavelet Transform and its relation to multirate filter banks

Frequency Domain Filtering

Complex Numbers Solutions

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

Parallel Vector Algorithms David A. Padua

Chapter 6 Infinite Series

Appendix F: Complex Numbers

Addition: Property Name Property Description Examples. a+b = b+a. a+(b+c) = (a+b)+c

Lecture Notes for Analysis Class

Digital Signal Processing, Fall 2006

Chapter 1. Complex Numbers. Dr. Pulak Sahoo

ECON 3150/4150, Spring term Lecture 3

Chapter 0. Review of set theory. 0.1 Sets

4.1 Sigma Notation and Riemann Sums

Signal Processing. Lecture 02: Discrete Time Signals and Systems. Ahmet Taha Koru, Ph. D. Yildiz Technical University.

PAPER : IIT-JAM 2010

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

Fall 2011, EE123 Digital Signal Processing

Definition of z-transform.

Random Variables, Sampling and Estimation

Introduction to Signals and Systems, Part V: Lecture Summary

Principle Of Superposition

SIGNALS AND SYSTEMS I Computer Assignment 1

Sensitivity Analysis of Daubechies 4 Wavelet Coefficients for Reduction of Reconstructed Image Error

Digital Signal Processing

Module 18 Discrete Time Signals and Z-Transforms Objective: Introduction : Description: Discrete Time Signal representation

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

6.003 Homework #12 Solutions

Multiresolution coding and wavelets. Interpolation error coding, I

a for a 1 1 matrix. a b a b 2 2 matrix: We define det ad bc 3 3 matrix: We define a a a a a a a a a a a a a a a a a a

A. Basics of Discrete Fourier Transform

M2.The Z-Transform and its Properties

Signals and Systems. Problem Set: From Continuous-Time to Discrete-Time

Polynomial Functions and Their Graphs

PRELIM PROBLEM SOLUTIONS

Spectral Analysis. This week in lab. Next classes: 3/26 and 3/28. Your next experiment Homework is to prepare

Further Concepts for Advanced Mathematics (FP1) MONDAY 2 JUNE 2008

Chimica Inorganica 3

Lecture 3 The Lebesgue Integral

R is a scalar defined as follows:

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.

Transcription:

Morphological Image Processig Biary dilatio ad erosio Set-theoretic iterpretatio Opeig, closig, morphological edge detectors Hit-miss filter Morphological filters for gray-level images Cascadig dilatios ad erosios Rak filters, media filters, majority filters Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 1

Biary images are commo Biary image processig l Itermediate abstractio i a gray-scale/color image aalysis system Thresholdig/segmetatio Presece/absece of some image property l Text ad lie graphics, documet image processig Represetatio of idividual pixels as 0 or 1, covetio: l foregroud, object = 1 (white) l backgroud = 0 (black) Processig by logical fuctios is fast ad simple Shift-ivariat logical operatios o biary images: morphological image processig Morphological image processig has bee geeralized to gray-level images via level sets Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 2

Shift-ivariace Assume that digital images f [x,y] ad g[x,y] have ifiite support [ x, y] {, 2, 1,0,1,2, } {, 2, 1,0,1,2, }... the, for all itegers a ad b [ ] g[ x, y] f x, y Shiftivariat system [ ] g[ x a, y b] f x a, y b Shiftivariat system Shift-ivariace does ot imply liearity (or vice versa). Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 3

Structurig elemet Neighborhood widow operator { } = f x W f x, y 180 degree rotatio { } x, y y : x, y Π xy structurig elemet ˆ W f x, y { } = { f x + x ʹ, y + yʹ x, yʹ } The hat otatio idicates Π xy Example structurig elemets : : ʹ Π xy upright structurig elemet (i.e., ot rotated!) 5x5 square x x cross y y Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 4

Biary dilatio (expadig foregroud) { } g x, y = OR W f x, y := dilate( f,w ) x f [x, y] Π y xy g[x, y] Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 5

Biary dilatio with square structurig elemet { } g x, y = OR W f x, y := dilate( f,w ) Expads the size of 1-valued objects Smoothes object boudaries Closes holes ad gaps Origial (701x781) dilatio with 3x3 structurig elemet dilatio with 7x7 structurig elemet Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 6

Biary erosio (shrikig foregroud) g x, y = AND W ˆ f x, y { } := erode( f,w ) x f [x, y] Π y xy g[x, y] Caveat: There is aother defiitio of erosio i the literature, which flips the structurig elemet, as for dilatio. The Laguita olie videos use that alterative defiitio. Matlab fuctio imerode uses the defiitio o this slide. To the best of our kowledge, there is o such discrepacy defiig dilatio. Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 7

Biary erosio with square structurig elemet g x, y = AND W ˆ f x, y { } := erode( f,w ) Origial (701x781) erosio with 3x3 structurig elemet erosio with 7x7 structurig elemet Shriks the size of 1-valued objects Smoothes object boudaries Removes peisulas, figers, ad small objects Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 8

Relatioship betwee dilatio ad erosio Duality: erosio is dilatio of the backgroud dilate f,w erode f,w ( ) ( ) = NOT erode NOT f ( ) = NOT dilate NOT f, Wˆ ( ), Wˆ But: erosio is ot the iverse of dilatio f ( ) ( ) x, y erode dilate( f,w ),W dilate erode( f,w ),W Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 9

Example: blob separatio/detectio by erosio Origial biary image Circles (792x892) Erosio by 30x30 structurig elemet Erosio by 70x70 structurig elemet Erosio by 96x96 structurig elemet Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 10

Example: blob separatio/detectio by erosio Origial biary image Circles (792x892) Erosio by disk-shaped structurig elemet Diameter=15 Erosio by disk-shaped structurig elemet Diameter=35 Erosio by disk-shaped structurig elemet Diameter=48 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 11

Example: chai lik fece hole detectio Origial grayscale image Fece (1023 x 1173) Fece thresholded usig Otsu s method Erosio with 151x151 cross structurig elemet Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 12

Set-theoretic iterpretatio Set of object pixels F {( x, y): f ( x, y) = 1} Backgroud: complemet of foregroud set F c {( x, y): f ( x, y) = 0} Dilatio is Mikowski set additio G = F Π xy Cotiuous (x,y). Works for discrete [x,y] i the same way. Commutative ad associative! { ( ) F, ( p x, p ) y Π } xy = ( x + p x, y + p y ): x, y ( p x,p y ) Π xy = F + px,p y ( ) traslatio of F ( by vector p x, p ) y Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 13

Set-theoretic iterpretatio: dilatio G F y x Π xy G = F Π xy { ( ) F, ( p x, p ) y Π } xy = ( x + p x, y + p y ): x, y = F + px,p y ( p x,p y ) Π xy ( ) Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 14

Set-theoretic iterpretatio: erosio G F Mikowski set subtractio Not commutative! Not associative! y x Π xy G = ( p x, p y ) Π xy F + px,p y ( ) = FΘΠ xy Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 15

Opeig ad closig Goal: smoothig without size chage Ope filter Close filter ( ) = dilate erode f,w ( ) = erode dilate f,w ope f,w close f,w ( ( ),W ) ( ),W ( ) Ope filter ad close filter are biased l Ope filter removes small 1-regios l Close filter removes small 0-regios l Bias is ofte desired for ehacemet or detectio! Ubiased size-preservig smoothers close ope f,w ope close f,w ( ( ),W ) ( ( ),W ) ( ) = close ope f,w ( ) = ope close f,w close-ope ad ope-close are duals, but ot iverses of each other. Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 16

Small hole removal by closig Origial biary mask Dilatio 10x10 Closig 10x10 Differece to origial mask Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 17

Morphological edge detectors f x, y dilate( f,w) f erode( f,w) f dilate( f,w) erode( f,w) Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 18

Recogitio by erosio Biary image f ( ) dilate erode( NOT f,w ),W 1400 2000 Structurig elemet W 44 34 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 19

Recogitio by erosio Structurig elemet W 44 34 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 20

Recogitio by erosio Biary image f ( ) dilate erode( NOT f,w ),W 1400 2000 Structurig elemet W 62 18 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 21

Recogitio by erosio Structurig elemet W 62 18 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 22

Hit-miss filter Biary image f ( ( ) & erode( f,w ),W ) dilate erode NOT f,v 1400 2000 Structurig elemet V 62 62 Structurig elemet W 18 18 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 23

Hit-miss filter Structurig elemet V 62 18 Structurig elemet W 62 18 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 24

Morphological filters for gray-level images Threshold sets of a gray-level image f [x,y] ( ) = x, y Τ θ f x, y { : f x, y θ}, < θ < + Recostructio of origial image from threshold sets f x, y { ( )} = sup θ : x, y Τ θ f x, y Idea of morphological operators for multi-level (or cotiuous-amplitude) sigals l Decompose ito threshold sets l Apply biary morphological operator to each threshold set l Recostruct via supremum operatio l Gray-level operators thus obtaied: flat operators! Flat morphological operators ad thresholdig are commutative Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 25

Dilatio/erosio for gray-level images Explicit decompositio ito threshold sets ot required i practice Flat dilatio operator: local maximum over widow W g x, y = max{ W { f x, y }}:= dilate f,w Flat erosio operator: local miimum over widow W ( ) g x, y = mi{ Wˆ { f x, y } }:= erode f,w ( ) Biary dilatio/erosio operators cotaied as special case Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 26

1-d illustratio of erosio ad dilatio Structurig elemet legth = Dilatio Erosio Origial Structurig elemet: horizotal lie Amplitude Sample o. Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 27

Image example Origial 394 x 305 Dilatio 10x10 square Erosio 10x10 square Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 28

Flat dilatio with differet structurig elemets Origial Diamod Disk 20 degree lie 9 poits 2 horizotal lies Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 29

Example: coutig cois thresholded 1 coected compoet Origial 20 coected compoets dilatio thresholded after dilatio Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 30

Example: chai lik fece hole detectio Origial grayscale image Fece (1023 x 1173) Flat erosio with 151x151 cross structurig elemet Biarized by Thresholdig Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 31

Morphological edge detector origial f dilatio g g f g-f g f thresholded Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 32

Beyod flat morphological operators Geeral dilatio operator g x, y = sup α,β Like liear covolutio, with sup replacig summatio, additio replacig multiplicatio Dilatio with uit impulse d α,β does ot chage iput sigal: { f x α, y β + w α,β } = sup = 0 α = β = 0 else α,β { } w x α, y β + f α,β f x, y = sup α,β { f x α, y β + d α,β } Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 33

Fid such that Aswer: w α,β f x, y Flat dilatio as a special case = sup α,β { f x α, y β + w α,β } = dilate f,w w α,β = 0 α,β Π xy else ( ) Hece, write i geeral g!" x, y# $ = sup{ f!" x α, y β # $ + w!" α,β # $ } α,β = dilate f,w ( ) = dilate( w, f ) Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 34

Geeral erosio for gray-level images Geeral erosio operator g x, y = if α,β Dual of dilatio g x, y = if α,β = sup α,β f x +α, y + β w α,β { } = erode( f,w) f x +α, y + β w α,β { } f x +α, y + β + w α,β { } = dilate( f,ŵ) Flat erosio cotaied as a special case Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 35

Cascaded dilatios f dilate( f,w 1 ) dilate ( f,w,w 1 2 ) dilate ( f,w,w,w 1 2 3) dilate dilate( f,w 1 ),w 2 = dilate( f,w) where w = dilate( w 1,w ) 2 Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 36

Cascaded erosios Cascaded erosios ca be lumped ito sigle erosio erode erode( f,w 1 ),w 2 = erode dilate ( f,ŵ 1 ),w 2 = dilate dilate( f,ŵ 1 ),ŵ 2 = dilate( f,ŵ) = erode( f,w) where w = dilate( w 1,w ) 2 New structurig elemet (SE) is ot the erosio of oe SE by the other, but dilatio. Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 37

Fast dilatio ad erosio Idea: build larger dilatio ad erosio operators by cascadig simple, small operators Example: biary erosio by 11x11 widow f x, y f x, y Erosio with 1x3 widow Erosio with 1x3 widow Erosio with 11x11 widow 5 stages g x, y g x, y Erosio with 3x1 widow Erosio with 3x1 widow 5 stages 120 AND per pixel 2x10 = 20 AND per pixel Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 38

Rak filters Geeralisatio of flat dilatio/erosio: i lieu of mi or max value i widow, use the p-th raked value Icreases robustess agaist oise Best-kow example: media filter for oise reductio Cocept useful for both gray-level ad biary images All rak filters are commutative with thresholdig Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 39

Media filter Gray-level media filter Biary images: majority filter Self-duality g x, y = media W f x, y { } g x, y = MAJ W f x, y media f,w majority f,w ( ) = media( f,w ) { } ( ) = NOT majority NOT f := media( f,w ) := majority( f,w ) (,W ) Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 40

Majority filter: example Biary image with 5% Salt&Pepper oise 3x3 majority filter 20% Salt&Pepper oise 3x3 majority filter Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 41

Media filter: example Origial image 5% Salt&Pepper oise 3x3 media filterig 7x7 media filterig Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 42

Example: o-uiform lightig compesatio Origial image 1632x1216 pixels Dilatio (local max) Rak filter 61x61 structurig elemet 10st brightest pixel 61x61 structurig elemet Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 43

Example: o-uiform lightig compesatio Backgroud origial image After global thresholdig Digital Image Processig: Berd Girod, 2013-2018 Staford Uiversity -- Morphological Image Processig 44