CS 556: Computer Vision Lecture 21 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu 1
Meanshift 2
Meanshift Clustering Assumption: There is an underlying pdf governing data properties in R Clustering based on estimating the underling pdf Each cluster corresponds to one mode of the pdf assumed pdf real data samples 3
Meanshift Clustering Assumption: There is an underlying pdf governing data properties in R Clustering based on estimating the underling pdf Each cluster corresponds to one mode of the pdf assumed pdf real data samples 3
Meanshift Clustering Assumption: There is an underlying pdf governing data properties in R Clustering based on estimating the underling pdf Each cluster corresponds to one mode of the pdf assumed pdf real data samples 3
Meanshift Clustering Assumption: There is an underlying pdf governing data properties in R Clustering based on estimating the underling pdf Each cluster corresponds to one mode of the pdf assumed pdf real data samples 3
Assumption: Parametric Density Estimation The functional form of the pdf is known Example: Mixture of Gaussians K k=1 C k exp 1 2 (x µ k) T 1 k (x µ k) assumed pdf real data samples 4
Assumption: Parametric Density Estimation The functional form of the pdf is known estimate Example: Mixture of Gaussians K k=1 C k exp 1 2 (x µ k) T 1 k (x µ k) assumed pdf real data samples 4
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
onparameteric Density Estimation Given data samples Estimate the pdf, P(x), at some value x by Counting data samples, xn, around x P (x) = 1 K(x x n ) data Data kernel 5
Common Kernels Epanechnikov K E (x) = c(1 x 2 ), x 1 0, otherwise Gaussian K G (x) = exp 1 2 x 2 6
Meanshift Clustering Goal = Identify modes o need to estimate the pdf Meanshift: Estimate the gradient of the pdf Cluster data that are in the attraction basin of a mode 7
Meanshift Clustering 8
Meanshift Clustering Region of interest 9
Meanshift Clustering Region of interest Center of mass 10
Meanshift Clustering Region of interest Center of mass Mean Shift vector 11
Meanshift Clustering Region of interest Center of mass 12
Meanshift Clustering Region of interest Center of mass 12
Meanshift Clustering Region of interest 12
Meanshift Clustering Region of interest 13
Meanshift Clustering Region of interest Center of mass 13
Meanshift Clustering Region of interest Center of mass Mean Shift vector 13
Kernel Density Gradient Estimation P (x) = 1 K(x x n ) P (x) = 1 K(x x n ) 14
Kernel Density Gradient Estimation P (x) = 1 K(x x n ) P (x) = 1 K(x x n ) K(x x n )=f x x n h 2 K(x x n ) = g n (x n x) g(x) = f(x) 14
Kernel Density Gradient Estimation P (x) = 1 K(x x n ) P (x) = 1 K(x x n ) K(x x n )=f x x n h 2 K(x x n ) = g n (x n x) g(x) = f(x) rp (x) = 1 X g n (x n x) = 1 g n g n x n g n x 14
Meanshift -- Algorithm Steps meanshift vector m(x) {z } P (x) = 1 g n g n x n g n x 1. Compute the meanshift vector m(x) 2. Translate the kernel window by m(x) 3. Repeat steps 1-2 until convergence 15
Meanshift -- Algorithm Steps meanshift vector m(x) P (x) = 1 g n g n x n g n x 1. Compute the meanshift vector m(x) 2. Translate the kernel window by m(x) 3. Repeat steps 1-2 until convergence 16
Meanshift -- Algorithm Steps meanshift vector m(x) P (x) = 1 g n g n x n g n x 1. Compute the meanshift vector m(x) 2. Translate the kernel window by m(x) 3. Repeat steps 1-2 until convergence 16
Experimental Results -- Meanshift Clustering input data colors denote distinct clusters 17
Results -- Meanshift Clustering input image pixel values in LUV color space 18
Results -- Meanshift Clustering (continued) input only LU final result trajectories in attraction basins 19
Results -- Meanshift Segmentation 20
Results -- Comparison Meanshift vs cuts input cuts Meanshift 21