Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem...
-
Upload
noah-cross -
Category
Documents
-
view
221 -
download
0
Transcript of Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem...
![Page 1: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/1.jpg)
Segmentation and Grouping
Computer VisionCS 543 / ECE 549
University of Illinois
Derek Hoiem
02/23/10
![Page 2: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/2.jpg)
Last week
• Clustering
• EM
![Page 3: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/3.jpg)
Today’s class
• More on EM
• Segmentation and grouping– Gestalt cues– By boundaries (watershed)– By clustering (mean-shift)
![Page 4: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/4.jpg)
EM
![Page 5: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/5.jpg)
Gestalt grouping
![Page 6: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/6.jpg)
German: Gestalt - "form" or "whole”
Berlin School, early 20th century
Kurt Koffka, Max Wertheimer, and Wolfgang Köhler
View of brain: • whole is more than the sum of its parts • holistic• parallel • analog • self-organizing tendencies
Slide from S. Saverese
Gestalt psychology or gestaltism
![Page 7: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/7.jpg)
The Muller-Lyer illusion
Gestaltism
![Page 8: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/8.jpg)
Explanation
![Page 9: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/9.jpg)
Principles of perceptual organization
From Steve Lehar: The Constructive Aspect of Visual Perception
![Page 10: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/10.jpg)
Principles of perceptual organization
![Page 11: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/11.jpg)
From Steve Lehar: The Constructive Aspect of Visual Perception
Grouping by invisible completion
![Page 12: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/12.jpg)
From Steve Lehar: The Constructive Aspect of Visual Perception
Grouping involves global interpretation
![Page 13: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/13.jpg)
Grouping involves global interpretation
From Steve Lehar: The Constructive Aspect of Visual Perception
![Page 14: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/14.jpg)
Gestaltists do not believe in coincidence
![Page 15: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/15.jpg)
Emergence
![Page 16: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/16.jpg)
Gestalt cues
• Good intuition and basic principles for grouping
• Difficult to implement in practice
• Sometimes used for occlusion reasoning
![Page 17: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/17.jpg)
Moving on to image segmentation …
Goal: Break up the image into meaningful or perceptually similar regions
![Page 18: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/18.jpg)
Segmentation for feature support
50x50 Patch50x50 Patch
![Page 19: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/19.jpg)
Segmentation for efficiency
[Felzenszwalb and Huttenlocher 2004]
[Hoiem et al. 2005, Mori 2005][Shi and Malik 2001]
![Page 20: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/20.jpg)
Segmentation as a result
Rother et al. 2004
![Page 21: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/21.jpg)
Types of segmentations
Oversegmentation Undersegmentation
Multiple Segmentations
![Page 22: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/22.jpg)
Major processes for segmentation
• Bottom-up: group tokens with similar features• Top-down: group tokens that likely belong to
the same object
[Levin and Weiss 2006]
![Page 23: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/23.jpg)
Segmentation using clustering
• Kmeans
• Mean-shift
![Page 24: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/24.jpg)
Source: K. Grauman
Feature Space
![Page 25: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/25.jpg)
Image Clusters on intensity Clusters on color
K-means clustering using intensity alone and color alone
![Page 26: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/26.jpg)
K-Means pros and cons• Pros
– Simple and fast– Easy to implement
• Cons– Need to choose K– Sensitive to outliers
• Usage– Rarely used for pixel
segmentation
![Page 27: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/27.jpg)
• Versatile technique for clustering-based segmentation
D. Comaniciu and P. Meer, Mean Shift: A Robust Approach toward Feature Space Analysis, PAMI 2002.
Mean shift segmentation
![Page 28: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/28.jpg)
Kernel density estimation
Kernel density estimation function
Gaussian kernel
![Page 29: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/29.jpg)
Mean shift algorithm
• Try to find modes of this non-parametric density
![Page 30: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/30.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Slide by Y. Ukrainitz & B. Sarel
Mean shift
![Page 31: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/31.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Slide by Y. Ukrainitz & B. Sarel
Mean shift
![Page 32: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/32.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Slide by Y. Ukrainitz & B. Sarel
Mean shift
![Page 33: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/33.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Mean shift
Slide by Y. Ukrainitz & B. Sarel
![Page 34: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/34.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Slide by Y. Ukrainitz & B. Sarel
Mean shift
![Page 35: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/35.jpg)
Region ofinterest
Center ofmass
Mean Shiftvector
Slide by Y. Ukrainitz & B. Sarel
Mean shift
![Page 36: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/36.jpg)
Region ofinterest
Center ofmass
Slide by Y. Ukrainitz & B. Sarel
Mean shift
![Page 37: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/37.jpg)
Real Modality Analysis
![Page 38: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/38.jpg)
• Attraction basin: the region for which all trajectories lead to the same mode
• Cluster: all data points in the attraction basin of a mode
Slide by Y. Ukrainitz & B. Sarel
Attraction basin
![Page 39: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/39.jpg)
Attraction basin
![Page 40: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/40.jpg)
Mean shift clustering• The mean shift algorithm seeks modes of the
given set of points1. Choose kernel and bandwidth2. For each point:
a) Center a window on that pointb) Compute the mean of the data in the search windowc) Center the search window at the new mean locationd) Repeat (b,c) until convergence
3. Assign points that lead to nearby modes to the same cluster
![Page 41: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/41.jpg)
• Find features (color, gradients, texture, etc)• Set kernel size for features Kf and position Ks
• Initialize windows at individual pixel locations• Perform mean shift for each window until convergence• Merge windows that are within width of Kf and Ks
Segmentation by Mean Shift
![Page 42: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/42.jpg)
http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html
Mean shift segmentation results
![Page 43: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/43.jpg)
http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html
![Page 44: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/44.jpg)
Mean-shift: other issues• Speedups
– Uniform kernel (much faster but not as good)– Binning or hierarchical methods– Approximate nearest neighbor search
• Methods to adapt kernel size depending on data density
• Lots of theoretical supportD. Comaniciu and P. Meer, Mean Shift: A Robust Approach toward Feature Space Analysis, PAMI 2002.
![Page 45: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/45.jpg)
Mean shift pros and cons
• Pros– Good general-practice segmentation– Finds variable number of regions– Robust to outliers
• Cons– Have to choose kernel size in advance– Original algorithm doesn’t deal well with high
dimensions• When to use it
– Oversegmentatoin– Multiple segmentations– Other tracking and clustering applications
![Page 46: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/46.jpg)
Watershed algorithm
![Page 47: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/47.jpg)
Watershed segmentation
Image Gradient Watershed boundaries
![Page 48: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/48.jpg)
Meyer’s watershed segmentation
1. Choose local minima as region seeds2. Add neighbors to priority queue, sorted by
value3. Take top priority pixel from queue
1. If all labeled neighbors have same label, assign to pixel
2. Add all non-marked neighbors
4. Repeat step 3 until finished
Meyer 1991Matlab: seg = watershed(bnd_im)
![Page 49: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/49.jpg)
Simple trick• Use median filter to reduce number of regions
![Page 50: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/50.jpg)
Watershed usage
• Use as a starting point for hierarchical segmentation– Ultrametric contour map (Arbelaez 2006)
• Works with any soft boundaries– Pb– Canny– Etc.
![Page 51: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/51.jpg)
Watershed pros and cons
• Pros– Fast (< 1 sec for 512x512 image)– Among best methods for hierarchical segmentation
• Cons– Only as good as the soft boundaries– Not easy to get variety of regions for multiple
segmentations– No top-down information
• Usage– Preferred algorithm for hierarchical segmentation
![Page 52: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/52.jpg)
Things to remember• Gestalt cues and principles of organization
• Uses of segmentation– Efficiency– Better features– Want the segmented object
• Mean-shift segmentation– Good general-purpose segmentation method – Generally useful clustering, tracking technique
• Watershed segmentation– Good for hierarchical segmentation– Use in combination with boundary prediction
![Page 53: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/53.jpg)
Further reading
• Mean-shift paper by Comaniciu and Meerhttp://www.caip.rutgers.edu/~comanici/Papers/MsRobustApproach.pdf
• Adaptive mean shift in higher dimensionshttp://mis.hevra.haifa.ac.il/~ishimshoni/papers/chap9.pdf
• Contours to regions (watershed): Arbelaez et al. 2009
http://www.eecs.berkeley.edu/~arbelaez/publications/Arbelaez_Maire_Fowlkes_Malik_CVPR2009.pdf
![Page 54: Segmentation and Grouping Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/23/10.](https://reader036.fdocuments.in/reader036/viewer/2022062305/56649e025503460f94aec9b1/html5/thumbnails/54.jpg)
Next class
• Graph-based segmentation– Normalized cuts– Graph cuts