M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 1
Types of segmentations
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 2
Segmentation as clustering
Segmentation as clustering
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 3
What will we learn today?
K-means clustering
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 4
Image segmentation: Toy example
white
pixels
3
pixel count
black pixels
gray
1 2 pixels
input image
intensity
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 5
Image segmentation: Toy example
pixel count
input image
intensity
pixel count
input image
intensity
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 6
Clustering
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 7
Best cluster centers?
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 8
K-means clustering
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 16
K-means clustering
Initialization:
► choose k cluster centers
Repeat:
► assignment step:
Until:
► The maximum number of iterations is reached
► OR
► OR
How to initialize?
► randomly from data
Safeguarding measure:
► try multiple initializations and choose the best
M. Shahzad: CS862 - Advanced Image Processing Lecture 12: Clustering via K-means and Meanshift 18