CS 4495 Computer Vision. Segmentation. Aaron Bobick (slides by Tucker Hermans) School of Interactive Computing. Segmentation

Similar documents
Segmentation and Grouping April 19 th, 2018

Grouping and Segmentation

Outline. Segmentation & Grouping. Examples of grouping in vision. Grouping in vision. Grouping in vision 2/9/2011. CS 376 Lecture 7 Segmentation 1

Segmentation and Grouping

Segmentation and Grouping April 21 st, 2015

Segmentation & Grouping Kristen Grauman UT Austin. Announcements

CMPSCI 670: Computer Vision! Grouping

Segmentation (continued)

Segmentation. Bottom Up Segmentation

CS 2770: Computer Vision. Edges and Segments. Prof. Adriana Kovashka University of Pittsburgh February 21, 2017

The goals of segmentation

CS 2750: Machine Learning. Clustering. Prof. Adriana Kovashka University of Pittsburgh January 17, 2017

Lecture: k-means & mean-shift clustering

Lecture: k-means & mean-shift clustering

Applications. Foreground / background segmentation Finding skin-colored regions. Finding the moving objects. Intelligent scissors

Segmentation & Clustering

Lecture 13: k-means and mean-shift clustering

Lecture 16 Segmentation and Scene understanding

CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu. Lectures 21 & 22 Segmentation and clustering

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation continued Graph Based Methods. Some slides: courtesy of O. Capms, Penn State, J.Ponce and D. Fortsyth, Computer Vision Book

Lecture 7: Segmentation. Thursday, Sept 20

Digital Image Processing

Clustering. Subhransu Maji. CMPSCI 689: Machine Learning. 2 April April 2015

Announcements. Segmentation & Grouping. Review questions. Outline. Grouping in vision. Examples of grouping in vision 9/21/2015

Lecture 10: Semantic Segmentation and Clustering

Computer Vision Lecture 6

Image Segmentation continued Graph Based Methods

Segmentation Computer Vision Spring 2018, Lecture 27

Segmentation and Grouping

Fitting: Voting and the Hough Transform April 23 rd, Yong Jae Lee UC Davis

CS 534: Computer Vision Segmentation and Perceptual Grouping

Grouping and Segmentation

Image Analysis. Segmentation by Clustering

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Clustering. So far in the course. Clustering. Clustering. Subhransu Maji. CMPSCI 689: Machine Learning. dist(x, y) = x y 2 2

Image Segmentation. Luc Van Gool, ETH Zurich. Vittorio Ferrari, Un. of Edinburgh. With important contributions by

Image Segmentation. Marc Pollefeys. ETH Zurich. Slide credits: V. Ferrari, K. Grauman, B. Leibe, S. Lazebnik, S. Seitz,Y Boykov, W. Freeman, P.

Targil 12 : Image Segmentation. Image segmentation. Why do we need it? Image segmentation

Stereo: Disparity and Matching

Announcements. Image Segmentation. From images to objects. Extracting objects. Status reports next Thursday ~5min presentations in class

2%34 #5 +,,% ! # %& ()% #% +,,%. & /%0%)( 1 ! # %& % %()# +(& ,.+/ +&0%//#/ &

Lecture 8: Fitting. Tuesday, Sept 25

Computer Vision Lecture 6

Normalized cuts and image segmentation

CS4670 / 5670: Computer Vision Noah Snavely

CS 4495 Computer Vision Motion and Optic Flow

CS4495/6495 Introduction to Computer Vision. 3B-L3 Stereo correspondence

CS 534: Computer Vision Segmentation and Perceptual Grouping

Texture. COS 429 Princeton University

Computer Vision II Lecture 4

Texture Representation + Image Pyramids

Colour Reading: Chapter 6. Black body radiators

Dr. Ulas Bagci

Clustering Color/Intensity. Group together pixels of similar color/intensity.

Lecture 11: E-M and MeanShift. CAP 5415 Fall 2007

Segmentation and low-level grouping.

Indexing local features and instance recognition May 16 th, 2017

Lecture 13 Segmentation and Scene Understanding Chris Choy, Ph.D. candidate Stanford Vision and Learning Lab (SVL)

In this lecture, we are going to talk about image segmentation, essentially defined as methods for grouping pixels together.

Image Segmentation. Computer Vision Jia-Bin Huang, Virginia Tech. Many slides from D. Hoiem

Texture April 14 th, 2015

Human Body Recognition and Tracking: How the Kinect Works. Kinect RGB-D Camera. What the Kinect Does. How Kinect Works: Overview

Color. Phillip Otto Runge ( )

Bag of Words Models. CS4670 / 5670: Computer Vision Noah Snavely. Bag-of-words models 11/26/2013

Clustering. Discover groups such that samples within a group are more similar to each other than samples across groups.

CS4670: Computer Vision

Indexing local features and instance recognition May 14 th, 2015

Chaplin, Modern Times, 1936

Today. Main questions 10/30/2008. Bag of words models. Last time: Local invariant features. Harris corner detector: rotation invariant detection

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Patch Descriptors. CSE 455 Linda Shapiro

Finding 2D Shapes and the Hough Transform

Digital Image Processing

Patch Descriptors. EE/CSE 576 Linda Shapiro

Texture April 17 th, 2018

Local Features and Bag of Words Models

Window based detectors

Announcements. Texture. Review: last time. Texture 9/15/2009. Write your CS login ID on the pset hardcopy. Tuesday, Sept 15 Kristen Grauman UT-Austin

CS6670: Computer Vision

Bias-Variance Trade-off (cont d) + Image Representations

Nonparametric Clustering of High Dimensional Data

Motion illusion, rotating snakes

EE795: Computer Vision and Intelligent Systems

Global Probability of Boundary

Stereo. 11/02/2012 CS129, Brown James Hays. Slides by Kristen Grauman

Region-based Segmentation

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

CS 558: Computer Vision 4 th Set of Notes

Previously. Part-based and local feature models for generic object recognition. Bag-of-words model 4/20/2011

Fitting a transformation: Feature-based alignment April 30 th, Yong Jae Lee UC Davis

6.801/866. Segmentation and Line Fitting. T. Darrell

EE 701 ROBOT VISION. Segmentation

Computer Vision II Lecture 4

Local Image Features

Image Analysis - Lecture 5

Local Image Features

Illumination and Shading

Content-based Image and Video Retrieval. Image Segmentation

Transcription:

CS 4495 Computer Vision Aaron Bobick (slides by Tucker Hermans) School of Interactive Computing

Administrivia PS 4: Out but I was a bit late so due date pushed back to Oct 29. OpenCV now has real SIFT again (the notfree packages). If using Python and OpenCV you should be able to use those calls. We re still investigating SIFT for Python for those *not* using OpenCV.

Why segmentation?

of Coherent Regions Berkeley segmentation database: http://www.eecs.berkeley.edu/research/projects/cs/vision/grouping/segbench/ Slide by Svetlana Lazebnik

Grouping of Similar Neighbors X. Ren and J. Malik. Learning a classification model for segmentation. ICCV 2003. Slide by Svetlana Lazebnik

Figure Ground Separate the foreground object (figure) from the background (ground) D. Tsai, M. Flagg, and J. M. Rehg. Motion Coherent Tracking with Multi-label MRF optimization. BMVC 2010.

Extensions Beyond Single Images J. Strom, A. Richardson, E. Olson. Graph-based for Colored 3D Laser Point Clouds. IROS 2010. M. Grundmann, V. Kwatra, M. Han, I. Essa. Efficient Hierarchical Graph-Based Video. CVPR 2010.

Kristen Grauman CS 4495 Computer Vision A. Bobick Image segmentation: toy example 1 2 3 input image pixel count black pixels intensity gray pixels white pixels These intensities define the three groups. We could label every pixel in the image according to which of these primary intensities it is. i.e., segment the image based on the intensity feature. What if the image isn t quite so simple?

Noisy Images pixel count input image intensity pixel count Kristen Grauman input image intensity

Noisy Images pixel count input image intensity Now how to determine the three main intensities that define our groups? We need to cluster. Kristen Grauman

Clustering 0 190 255 intensity 1 2 3 Goal: choose three centers as the representative intensities, and label every pixel according to which of these centers it is nearest to. Best cluster centers are those that minimize SSD between all points and their nearest cluster center ci: Kristen Grauman

Kristen Grauman CS 4495 Computer Vision A. Bobick Clustering With this objective, it is a chicken and egg problem: Q: how to determine which points to associate with each cluster center, c i? A: for each point p, choose closest c i Q: If we knew the group memberships, how do we get the centers? A: choose c i to be the mean of all points in the cluster

K-means clustering: Algorithm 1. Randomly initialize the cluster centers, cc 1,, cc KK 2. Given cluster centers, determine points in each cluster For each point p, find the closest cc ii. Put p into cluster i 3. Given points in each cluster, solve for cccc Set cc ii to be the mean of points in cluster i 4. If cc ii have changed, repeat Step 2 Text by Steve Seitz

Andrew Moore

Andrew Moore

Andrew Moore

Andrew Moore

Andrew Moore

as clustering Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on intensity similarity Feature space: intensity value (1-d) Source: K. Grauman

Number of Clusters K=2 K=3 quantization of the feature space; segmentation label map

as clustering Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on color similarity R=255 G=200 B=250 B G R=245 G=220 B=248 R Feature space: color value (3-d) R=15 G=189 B=2 R=3 G=12 B=2 Kristen Grauman

as clustering K-means clustering based on intensity or color is essentially vector quantization of the image attributes Image Intensity-based clusters Color-based clusters Slide by Svetlana Lazebnik

as clustering Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on intensity+position similarity Intensity Y Kristen Grauman X Both regions are black, but if we also include position (x,y), then we could group the two into distinct segments; way to encode both similarity & proximity.

as clustering Source: K. Grauman

as clustering Clustering based on (r,g,b,x,y) values enforces more spatial coherence Slide by Svetlana Lazebnik

K-Means for segmentation Pros Very simple method Converges to a local minimum of the error function Cons Memory-intensive Need to pick K Sensitive to initialization Sensitive to outliers Only finds spherical clusters Slide by Svetlana Lazebnik

as clustering Color, brightness, position alone are not enough to distinguish all regions

as clustering Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on texture similarity F 1 F 2 Filter bank of 24 filters F 24 Feature space: filter bank responses (e.g., 24-d) Kristen Grauman

CS 4495 Computer Vision A. Bobick Aside: Texture representation example Windows with primarily horizontal edges Dimension 2 (mean d/dy value) Both Dimension 1 (mean d/dx value) mean d/dx value mean d/dy value Win. #1 4 10 Win.#2 18 7 Win.#9 20 20 Kristen Grauman Windows with small gradient in both directions Windows with primarily vertical edges statistics to summarize patterns in small windows

Aside: Texture features Find textons by clustering vectors of filter bank outputs Describe texture in a window based on its texton histogram Image Texton map Count Texton index Count Count Texton index Texton index Malik, Belongie, Leung and Shi. IJCV 2001. Adapted from Lana Lazebnik

Image segmentation example Kristen Grauman

Make it better K-means heavily sensitive to initial conditions and (typically) need to know K in advance. Suppose we assume that there are a few modes in the image and that all the pixels come from these modes. If you could find the modes you might be able to segment the image.

Mean shift algorithm The mean shift algorithm seeks modes or local maxima of density in the feature space image Feature space (L*u*v* color values)

A digression about color Color is an inherently perceptual phenomena. Only related but not the same as wavelength of light energy. In fact only some colors are found in the spectrum

Colors perceivable by the human eye CIE xy chromaticity diagram, 1931

CIE XYZ color space (1931) A space with desired properties Easy to compute linear transform of CIE RGB Y: Perceived luminance X, Z: Perceived color Represents a wide range of colors

Colors perceivable by the human eye y = y = X X + Y + Z Y X + Y + Z CIE xy chromaticity diagram, 1931

CIE L*a*b* color space L = 25% L = 50% L = 75%

Cylindrical view Think of chroma (here a*, b*) defining a planar disc at each luminance level (L)

HSL and HSV color spaces

But there are lots of color spaces

The one we know best RGB color space

My favorite

Like a squared double cone?

Mean shift algorithm The mean shift algorithm seeks modes or local maxima of density in the feature space image Feature space (L*u*v* color values)

Slide by Y. Ukrainitz & B. Sarel CS 4495 Computer Vision A. Bobick Mean shift Search window Center of mass Mean Shift vector

Mean shift Search window Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Search window Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Search window Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Search window Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Search window Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel

Mean shift clustering Cluster: all data points in the attraction basin of a mode Attraction basin: the region for which all trajectories lead to the same mode Slide by Y. Ukrainitz & B. Sarel

Mean shift clustering/segmentation Find features (color, gradients, texture, etc) Initialize windows at individual feature points (pixels) Perform mean shift for each window (pixel) until convergence Merge windows (pixels) that end up near the same peak or mode

Mean shift segmentation results http://www.caip.rutgers.edu/~comanici/mspami/mspamiresults.html

Mean shift segmentation results

Mean shift Pros: Does not assume shape on clusters One parameter choice (window size) Generic technique Find multiple modes Cons: Selection of window size Does not scale well with dimension of feature space Kristen Grauman

Images as graphs q p w pq w Fully-connected graph node (vertex) for every pixel link between every pair of pixels, p,q affinity weight w pq for each link (edge) w pq measures similarity similarity is inversely proportional to difference (in color and position ) Source: Steve Seitz

Measuring affinity One possibility: Small sigma: group only nearby points Large sigma: group distant points Kristen Grauman

by graph partitioning j i w ij A B C Break Graph into Segments Delete links that cross between segments Easiest to break links that have low affinity similar pixels should be in the same segments dissimilar pixels should be in different segments Source: S. Seitz

Graph cut A B Set of edges whose removal makes a graph disconnected Cost of a cut: sum of weights of cut edges cut( A, B) w p, q p A, q B A graph cut gives us a segmentation What is a good graph cut and how do we find one? = Source: S. Seitz

Cuts in a graph: Min cut A B cut( A, B) = w p, q p A, q B Find minimum cut gives you a segmentation fast algorithms exist for doing this (we may see this ) Source: Steve Seitz

Minimum cut Problem with minimum cut: Weight of cut proportional to number of edges in the cut; tends to produce small, isolated components. [Shi & Malik, 2000 PAMI]

Cuts in a graph: Normalized cut A B Normalized Cut fix bias of Min Cut by normalizing for size of segments: cut( A, B) assoc( A, V ) cut( A, B) assoc( B, V ) assoc(a,v) = sum of weights of all edges that touch A Ncut value small when we get two clusters with many edges with high weights, and few edges of low weight between them Approximate solution for minimizing the Ncut value : generalized eigenvalue problem. + J. Shi and J. Malik, Normalized Cuts and Image, CVPR, 1997 Source: Steve Seitz

Example results

Results: Berkeley Engine http://www.cs.berkeley.edu/~fowlkes/bse/

Normalized cuts: pros and cons Pros: Generic framework, flexible to choice of function that computes weights ( affinities ) between nodes Does not require model of the data distribution Cons: Time complexity can be high Dense, highly connected graphs many affinity computations Solving eigenvalue problem Preference for balanced partitions Kristen Grauman

The end

Geometry of Color (CIE) Perceptual color spaces are non-convex Three primaries can span the space, but weights may be negative. Curved outer edge consists of single wavelength primaries Source: Jim Rehg

RGB Color Space Many colors cannot be represented (phosphor limitations) Source: Jim Rehg

Uniform color spaces McAdam ellipses (next slide) demonstrate that differences in x,y are a poor guide to differences in color Construct color spaces so that differences in coordinates are a good guide to differences in color. Source: Jim Rehg

McAdam ellipses Figures courtesy of D. Forsyth

LUV Color Space

HSV Color Space RGB HSV Source: Intel IPP

LUV Color Space RGB LUV More info see: http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch6/ch6_color_models.html Source: Intel IPP