Image Segmentation
Computer Vision Jia-Bin Huang, Virginia Tech
Many slides from D. Hoiem
Image Segmentation Computer Vision Jia-Bin Huang, Virginia Tech - - PowerPoint PPT Presentation
Image Segmentation Computer Vision Jia-Bin Huang, Virginia Tech Many slides from D. Hoiem Administrative stuffs HW 3 due 11:59 PM, Oct 17 (Wed) Final project proposal due Oct 23 (Mon) Title Problem Tentative approach
Many slides from D. Hoiem
enforce rank 2 using SVD
constraints, resolve affine ambiguity
x1j x2j x3j Xj P1 P2 P3
xij = Pi Xj , i = 1,… , m, j = 1, … , n
from the mn corresponding 2D points xij
x1j x2j x3j Xj P1 P2 P3
Slides: Lana Lazebnik
points in image i
A = U3W3
½ and S = W3 ½ V3 T
Source: M. Hebert
Source: Y. Furukawa
Source: Y. Furukawa
Source: Y. Furukawa
Source: Y. Furukawa
reference view
reference camera input image
input image
Image 1 Image 2 Sweeping plane Scene surface
Hardware, CVPR 2003
depth map w.r.t. that view using a multi-baseline approach
volume or a mesh (see, e.g., Curless and Levoy 96)
Map 1 Map 2 Merged
problems?
German: Gestalt - "form" or "whole” Berlin School, early 20th century Kurt Koffka, Max Wertheimer, and Wolfgang Köhler
Slide from S. Saverese
The Muller-Lyer illusion
From Steve Lehar: The Constructive Aspect of Visual Perception
From Steve Lehar: The Constructive Aspect of Visual Perception
From Steve Lehar: The Constructive Aspect of Visual Perception
From Steve Lehar: The Constructive Aspect of Visual Perception
[Felzenszwalb and Huttenlocher 2004] [Hoiem et al. 2005, Mori 2005] [Shi and Malik 2001]
50x50 Patch 50x50 Patch
“Selective Search” [Sande, Uijlings et al. ICCV 2011, IJCV 2013] [Endres Hoiem ECCV 2010, IJCV 2014]
Rother et al. 2004
[Levin and Weiss 2006]
Source: K. Grauman
Partition the data into K sets S = {S1, S2, … SK} with corresponding centers μi Partition such that variance in each partition is as low as possible
Partition the data into K sets S = {S1, S2, … SK} with corresponding centers μi Partition such that variance in each partition is as low as possible
function C = kmeans(X, K) % Initialize cluster centers to be randomly sampled points [N, d] = size(X); rp = randperm(N); C = X(rp(1:K), :); lastAssignment = zeros(N, 1); while true % Assign each point to nearest cluster center bestAssignment = zeros(N, 1); mindist = Inf*ones(N, 1); for k = 1:K for n = 1:N dist = sum((X(n, :)-C(k, :)).^2); if dist < mindist(n) mindist(n) = dist; bestAssignment(n) = k; end end end % break if assignment is unchanged if all(bestAssignment==lastAssignment), break; end; % Assign each cluster center to mean of points within it for k = 1:K C(k, :) = mean(X(bestAssignment==k, :)); end end
Image Clusters on intensity Clusters on color
K-means clustering using intensity alone and color alone
–Simple and fast –Easy to implement
–Need to choose K –Sensitive to outliers
–Rarely used for pixel segmentation
Kernel Data (1-D) Estimated density
Kernel density estimation function Gaussian kernel
Region of interest Center of mass Mean Shift vector
Slide by Y. Ukrainitz & B. Sarel
Region of interest Center of mass Mean Shift vector
Slide by Y. Ukrainitz & B. Sarel
Region of interest Center of mass Mean Shift vector
Slide by Y. Ukrainitz & B. Sarel
Region of interest Center of mass Mean Shift vector
Slide by Y. Ukrainitz & B. Sarel
Region of interest Center of mass Mean Shift vector
Slide by Y. Ukrainitz & B. Sarel
Region of interest Center of mass Mean Shift vector
Slide by Y. Ukrainitz & B. Sarel
Region of interest Center of mass
Slide by Y. Ukrainitz & B. Sarel
Simple Mean Shift procedure:
2 1 2 1
n i i i n i i
Slide by Y. Ukrainitz & B. Sarel
Slide by Y. Ukrainitz & B. Sarel
1. Choose kernel and bandwidth 2. For each point:
a) Center a window on that point b) Compute the mean of the data in the search window c) Center the search window at the new mean location d) Repeat (b,c) until convergence
3. Assign points that lead to nearby modes to the same cluster
each pixel’s position
http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html
http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html
–Binned estimation – replace points within some “bin” by point at center with mass –Fast search of neighbors – e.g., k-d tree or approximate NN –Update all windows in each iteration (faster convergence)
–Use kNN to determine window sizes adaptively
toward Feature Space Analysis, PAMI 2002.
finding most common surface normals)
Mean Shift, Best Paper Award, IEEE Conf. Computer Vision and Pattern Recognition (CVPR'00), Hilton Head Island, South Carolina, Vol. 2, 142-149, 2000
http://saravananthirumuruganathan.wordpress.com/2010/04/01/introduction-to-mean-shift- algorithm/
http://www.caip.rutgers.edu/~comanici/Papers/MsRobustApproach.pdf
http://mis.hevra.haifa.ac.il/~ishimshoni/papers/chap9.pdf
Image Gradient Watershed boundaries
1. If all labeled neighbors have same label, assign that label to pixel 2. Add all non-marked neighbors to queue
Meyer 1991
–Ultrametric contour map (Arbelaez 2006)
–Pb (w/o non-max suppression) –Canny (w/o non-max suppression) –Etc.
–Fast (< 1 sec for 512x512 image) –Preserves boundaries
–Only as good as the soft boundaries (which may be slow to compute) –Not easy to get variety of regions for multiple segmentations
–Good algorithm for superpixels, hierarchical segmentation
+ Good for thin regions + Fast + Easy to control coarseness of segmentations + Can include both large and small regions
http://www.cs.brown.edu/~pff/segment/
http://www.cs.toronto.edu/~kyros/pubs/09.pami.turbopixels.pdf
Tries to preserve boundaries like watershed but to produce more regular regions
grid in steps S
window with smallest gradient
center within 2S pixel distance and assign to nearest
mean color/position of pixels belonging to each cluster
small
http://infoscience.epfl.ch/record/177415/files/Superpixel_PAMI2011-2.pdf + Fast 0.36s for 320x240 + Regular superpixels + Superpixels fit boundaries
http://www.cs.brown.edu/~pff/segment/
IJCV 2011 (uses trained classifier to merge)
2009
mean-shift segmentations
(Endres Hoiem ECCV 2010, Carreira Sminchisescu CVPR 2010)
–Efficiency –Better features –Propose object regions –Want the segmented object
–Good general-purpose segmentation method –Generally useful clustering, tracking technique
–Good for hierarchical segmentation –Use in combination with boundary prediction