|
1
|
- Project 4 questions
- Evaluations
|
|
2
|
- Today’s Readings
- Forsyth chapter 14
- http://www.dai.ed.ac.uk/HIPR2/morops.htm
- Dilation, erosion, opening, closing
|
|
3
|
- What Defines an Object?
- Subjective problem, but has been well-studied
- Gestalt Laws seek to formalize this
- proximity, similarity, continuation, closure, common fate
- see notes by Steve Joordens, U. Toronto
|
|
4
|
- We will consider different methods
- Already covered:
- Intelligent Scissors (contour-based)
- Hough transform (model-based)
- Today:
- K-means clustering (color-based)
- Normalized Cuts (region-based)
|
|
5
|
- How many “orange” pixels are in this image?
- This type of question answered by looking at the histogram
- A histogram counts the number of occurrences of each color
- Given an image
- The histogram is defined to be
- What is the dimension of the histogram of an NxN RGB image?
|
|
6
|
|
|
7
|
- Goal
- Break the image into K regions (segments)
- Solve this by reducing the number of colors to K and mapping each pixel
to the closest color
|
|
8
|
- Goal
- Break the image into K regions (segments)
- Solve this by reducing the number of colors to K and mapping each pixel
to the closest color
|
|
9
|
- How to choose the representative colors?
- This is a clustering problem!
|
|
10
|
- Suppose I tell you the cluster centers ci
- Q: how to determine which points
to associate with each ci?
|
|
11
|
- K-means clustering algorithm
- Randomly initialize the cluster centers, c1, ..., cK
- Given cluster centers, determine points in each cluster
- For each point p, find the closest ci. Put p into cluster i
- Given points in each cluster, solve for ci
- Set ci to be the mean of points in cluster i
- If ci have changed, repeat Step 2
- Java demo: http://www.elet.polimi.it/upload/matteucc/Clustering/tutorial_html/AppletKM.html
- Properties
- Will always converge to some solution
- Can be a “local minimum”
- does not always find the global minimum of objective function:
|
|
12
|
- Basic questions
- what’s the probability that a point x is in cluster m?
- what’s the shape of each cluster?
- K-means doesn’t answer these questions
- Probabilistic clustering (basic idea)
- Treat each cluster as a Gaussian density function
|
|
13
|
- A probabilistic variant of K-means:
- E step: “soft assignment” of points to clusters
- estimate probability that a point is in a cluster
- M step: update cluster
parameters
- mean and variance info (covariance matrix)
- maximizes the likelihood of the points given the clusters
- Forsyth Chapter 16 (optional)
|
|
14
|
- http://www.cs.ucsd.edu/users/ibayrakt/java/em/
|
|
15
|
- Turns out this is useful for all sorts of problems
- any clustering problem
- model estimation with missing/hidden data
- finding outliers
- segmentation problems
- segmentation based on color
- segmentation based on motion
- foreground/background separation
- ...
|
|
16
|
- Problem:
- Histogram-based segmentation can produce messy regions
- segments do not have to be connected
- may contain holes
- How can these be fixed?
|
|
17
|
|
|
18
|
- Demo
- http://www.cs.bris.ac.uk/~majid/mengine/morph.html
|
|
19
|
|
|
20
|
- Demo
- http://www.cs.bris.ac.uk/~majid/mengine/morph.html
|
|
21
|
- What does this operation do?
|
|
22
|
- What does this operation do?
|
|
23
|
- What does this operation do?
|
|
24
|
|
|
25
|
- Fully-connected graph
- node for every pixel
- link between every pair of pixels, p,q
- cost cpq for each link
- cpq measures similarity
- similarity is inversely proportional to difference in color and
position
- this is different than the costs for intelligent scissors
|
|
26
|
- Break Graph into Segments
- Delete links that cross between segments
- Easiest to break links that have low cost (similarity)
- similar pixels should be in the same segments
- dissimilar pixels should be in different segments
|
|
27
|
- Link Cut
- set of links whose removal makes a graph disconnected
- cost of a cut:
|
|
28
|
|
|
29
|
|
|
30
|
- Treat the links as springs and shake the system
- elasticity proportional to cost
- vibration “modes” correspond to segments
- can compute these by solving an eigenvector problem
- Forsyth chapter 14.5
|
|
31
|
- Treat the links as springs and shake the system
- elasticity proportional to cost
- vibration “modes” correspond to segments
- can compute these by solving an eigenvector problem
- Forsyth chapter 14.5
|
|
32
|
|