Binary Shape Analysis
Binary Shape Analysis
1
Outline
{ Midterm-related information
{ Class on February 10
{ Assignment 2
{ Mathematical morphology
z Reading: 13.1, 13.2, 13.3
2
Midterm-related information
{ Friday February 13 in class
{ Course topics:
z Image formation (2.2, 2.3, 2.4, 2.5)
z Colour, light and shading
z Segmentation (6)
{ A more detailed list of topics will be posted on the
course web site
{ Allowed materials: one (1) 8.5" x 11" sheet of paper
with any notes you want on both sides (except
descriptions of algorithms); calculator.
3
Midterm-related information (contd)
4
Midterm Question samples (1)
{ Using a standard slope-intercept line
representation, explain the main concept
of Hough transform for line detection.
Draw several lines in the image space and
sketch the corresponding Hough
transform in the parameter space. Label
all important points, lines, and axes.
{ Explain why the polar representation of
lines is more suitable for line detection
using the Hough transform than the
standard line representation.
5
Midterm Question samples (2)
6
Midterm Question samples (3)
{ Consider a gray-scale image depicting
several objects on a background with a
bimodal histogram. How will the
classification error vary with the choice of
the threshold?
{ Will the area of the segmented object be
more sensitive if the histogram peaks are
narrow or if they are wide?
7
Class on February 10
8
Assignment 2
9
Outline
{ Midterm-related information
{ Class on February 10
{ Assignment 2
{ Mathematical morphology
z Reading: 13.1, 13.2, 13.3
10
What is mathematical morphology?
11
Mathematical morphology tools
In mathematical morphology, images are
defined as sets of pixels
{ Basic morphological operators are similar to
convolution but using set operations (non-
linear algebra)
{ Morphological operators are useful for:
z Preprocessing
z Postprocessing
z Segmentation
z Representation
12
Basic morphological operators
{ Mostly used in preprocessing or
postprocessing (after segmentation)
z Dilation
z Erosion
z Opening (dilation+erosion)
z Closing (erosion + dilation)
13
Set Operations on Binary Images
A the image (on pixels)
{ Ac the complement of the image (inverse)
{ AB the union of images A and B
14
Translation
The image A translated by movement vector t
is
{ At = {c | c = a + t for some a in A}
15
Dilation
{ We consider set A and a structuring element B.
{ We combine these two sets using vector
addition
17
Applications of dilation: restoration of
shape continuity
18
Example of Dilation
Structuring
Element
19
Properties of dilation
20
Erosion
In terms of translation:
21
Result of erosion depends on the
shape of the structuring element
22
Example of Erosion
Structuring
Element
23
Properties of erosion
{ Not commutative
{ Not associative
24
25
Duality
{ Dual operations are ones that can be defined in
terms of each other. Duals are not inverse
operations
26
Boundary extraction using dilation and
erosion
27
Finding boundary pixels
28
Opening
{ erosion followed by dilation
30
Properties of opening and closing
{ Opening and closing are also duals:
31
Applications of opening and closing
32
Conditional dilation
{ Conditional dilation involves dilation of an image
followed by intersection with some other condition
image.
{ Application:
33
Conditional dilation applied to shape
morphing (example)
Shape morphing:
a) superposition of the initial shape obj1(green boundary) and the
final shape obj2 (blue boundary);
b) initial shape in grey ;
c), d), e), f) intermediate morphing iterations, resulting in grey
objects with red boundaries;
g) final shape(obj2)
34
Hit or miss operator
{ Can be considered as a binary template
matching
{ Needs two structuring elements: one that
must hit, the other that must miss
{ Example: detection of an upper right corner
z J (hit) finds points with connected left and lower
neighbors
z K (miss) finds points without upper, upper right
and right neighbors
35
Detection of the convex hull using the
hit-and-miss operator
Image of Image of
36
objects convex hulls
37
Detection of the skeleton of the object
38
Skeleton representation
39
Morphological derivation of the
skeleton
40
41
Examples of morphological processing
42
Example 1. Segmentation of cells from a microscopy
image (See Matlab demos for Image processing toolbox)
43
filling the gaps in the lines surrounding the object
followed by
2. Dilation using a horizontal structuring element
44
45
Remove objects connected on border
46
Smoothing with a double erosion
47
Example2. Extracting patterns from an image
48