程序代写代做代考 matlab algorithm CMP 3108, IMAGE PROCESSING LECTURE 7

CMP 3108, IMAGE PROCESSING LECTURE 7
MORPHOLOGY IMAGE PROCESSING
Dr Xujiong Ye
Lincoln School of Computer Science

Mathematical Morphology
• Basic morphological operators take as input: • Original (binary) image
• Structuring element (SE)
• Basic concepts:
• Erosion and dilation • Opening and closing

Quiz
• Which morphology operator do you consider to apply?
Erosion
3

Quiz
• Which morphology operator do you consider to apply?
Input Image Closing
Opening
4

Quiz
• Which morphology operator do you consider to apply?
Input Image
Opening Closing
5

This Week
Morphology Image Processing
• Hit-or-Miss Transform (Corner Detection) • Boundary Extraction
• Connected Components (Labelling)
Image SegmentaPon
• Edge based (Canny detector)
6

Hit-or-Miss Transform
• “Template matching” A∗B=(A−B)∩(AC −B )
• Now structuring element consists two parts:
• object part (B1) and background part (B2)
• Both parts must match exactly with corresponding area of the input images, i.e.
• B1 must fit the object part of the input image, and
• B2 must fit the background
12

Hit-or-Miss Transform
• Example for a Hit-and-miss Structuring Element • Contains 0s, 1s and don’t care’s.
• Usually a “1” at the origin!

Corner Detection with Hit-or-Miss Transform
• Structuring Elements representing four corners

Corner Detection with Hit-or-miss Transform
• Apply each Structuring Element
• Use OR operation to combine the four results

Hit-or-Miss Transform
• Example: Hit-or-Miss Transform to find isolated points
input image 4-connected isolated points (A⊛B)
B1 B2
SE for 4-connected isolated points

Hit-or-Miss Transform
• Example: Hit-or-Miss Transform to find endpoints
input image
endpoints
(A⊛Ba ∪ A⊛Bb ∪ A⊛Bc ∪ A⊛Bd)
B1 Ba2 Bb2
Bc2 Bd2
SEs for 4-connected endpoints

Basic Morphological Algorithms
• Based on erosion, dilation, opening, closing, hit-or-miss
• Basic algorithms include: • boundary extraction
• extracting connected components • region filling
• etc

Boundary Extraction
• Erosion and set difference • β(A) ≡ boundary of A
β(A)= A−(A−B)

Boundary Extraction
• Erosion and set difference • β(A) ≡ boundary of A
β(A)= A−(A−B)

Extracting Connected Components
• Each component is labelled with a separate identity

Extracting Connected Components
• start with a point p = X0 inside Y
• iterative dilation and intersection with A
Xk =(Xk−1⊕B)∩A
• terminate if Xk = Xk-1
• final result:
set union Y=Xk-1=Xk
X0 X0

X0 X1 X2
X0 X0
X3 X4 Y
CMP3005/6: Semester A, Lecture 6 – Morphological Image Processing Dr. Grzegorz Cielniak
B

Connected Components Labeling
The connected components operation takes in a binary image and produces a labeled image in which each pixel has the integer label of either the background (0) or a component.
original thresholded opening+closing components

Region Filling
• Foreground and Background
• Oi – connected components of the foreground
• O – foreground = union of all Oi
• OC – the complement of O, can be further divided into
• background:
subset of OC connected
to the border of the image
• holes:
remaining part of OC

Region Filling
• Filling Holes Using Connected Component Labeling
• holes = foreground in the inverse image – components touching the image border
• output = original image + holes +=
original image holes output

Matlab IPT FuncPon: • Fill Hole
BW2=imfill(BW)
• Connected component (Region labeling)
[L,num]=bwlabel(BW, conn)
22

InterpolaPon
Enhancement-1
Histogram Processing
Enhancement-2
Sharpening (Sobel & Laplacian)
Image Analysis
Syllabus
Fundamentals
IntroducFon Module IntroducPon, Origins of Image Processing (Imaging), Imaging ModaliPes
Image FormaPon, Pixels, SpaPal & Intensity ResoluPons, Grey Level TransformaPons: Contrast Stretching,
SpaPal Filtering: Smoothing (Averaging, Median),
Morphological Image Processing Image SegmentaFon
ApplicaFons
Colour Image Processing
Image Compression RepresentaFon and DescripFon Real-world ApplicaFons
Image AcquisiFon

Image SegmentaFon
• SegmentaPon is the process of parPPoning an image into regions with respect to a parPcular applicaPon
Ø region: group of connected pixels with similar properPes
Ø properPes: grey levels, colours, textures, moPon characterisPcs (moPon vectors), edge conPnuity …

Image SegmentaFon
• Common Approaches to SegmentaPon
• edge-based
• search for edges in the image
• edges can be linked to obtain borders between regions
• region-based
• thresholding, region growing, region spliang & merging,
watershed, etc
• moPon-based
• separate moving foreground objects from background model

Example 1: segmentaFon based on edges

Example 2: segmentaFon based on grayscale
• Very simple ‘model’ of greyscale leads to inaccuracies in object labelling

Example 3: segmentaFon based on texture

Recommended Reading
“Digital Image Processing”, R.C. Gonzalez and R.E. Woods, 3rd ediPon, Pearson PrenPce Hall, 2008
Chapter 9