CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

15
CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann

Transcript of CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Page 1: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

CS 376bIntroduction to Computer Vision

04 / 02 / 2008

Instructor: Michael Eckmann

Page 2: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Today’s Topics• Comments/Questions• a few more C++ programming comments for current assignment

– make the two gradient magnitude thresholds easily changeable between runs of your program --- why?

– computing binary local partition values at border (of image/ of region) pixels --- then how to normalize the histogram?

• one last comment on motion• Segmentation algorithms

– clustering– region growing– boundary detection

Page 3: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Motion heuristics• Besides the assumptions of possibly knowing

the maximum velocity of a world point (and hence what the appropriately sized window is to look in), there are a few other heuristics worth mentioning.

• Small velocity change (example on board)– from frame f

i to f

i+1 to f

i+2 ... assume a point in f

i

was found in fi+1

and that point was found in fi+2

. the velocity of the motion between f

i and f

i+1

ashould be similar too the velocity of the motion between f

i+1 and f

i+2

Page 4: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Motion heuristics• Common motion among point determined to be

on the same object (after some kind of segmentation (e.g. segmentation of motion)) – this had already come up during discussions

• 2 points from one image do not generally match the same point in the next image. Occlusions could make this assumption invalid though.

• If one knows the expected world motion of an object, one can use this to help predict and/or recognize the motion within an image sequence.

Page 5: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• The goal of segmentation is

– to determine the different regions in an image that each represent a meaningful area

– these regions can then be further analyzed• e.g. segment an image into a face and other regions,

then use the face for identification

– depending on the domain, and possibly adding domain specific information, choose (or develop) a particular segmentation algorithm

Page 6: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• Regions after segmentation should have the

following characteristics– uniform and homogeneous with respect to some

measure (e.g. greylevel, color, texture, motion)– interiors of regions should not have many small

holes– adjacent regions should have significantly different

values with respect to the chosen characteristic

Page 7: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• Difference between clustering and region growing

schemes.• Each pixel is represented as an n-dimensional vector,

which encodes the segmentation characteristic• Clustering:

– partition all the pixels into K classes– similar characteristics is the primary here

• Region Growing:– start at some pixel in the image– add adjacent pixels to that pixel's region if they are

similar, if not, start a new region– adjacency is primary here, similarity secondary

Page 8: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• What does similar mean? • figure 10.3 from Shapiro and Stockman

Page 9: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Segmentation• Iterative K-means clustering (from Shapiro and

Stockman)

• D(xi, m

k(ic)) = || x

i – m

k || 2

Page 10: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Segmentation• Overall desire is to minimize the least squares error

measure (from page 282 on the board).• Can think of each mean as a centroid in n-dimensions• It's a greedy algorithm• Results clearly depend on chosen K• Results depend on initially chosen means

– standard solution (according to page below) is try various different initial means and then pick your favorite result

• Let's look here for some additional comments on K-means clustering

• http://home.dei.polimi.it/matteucc/Clustering/tutorial_html/kmeans.html

Page 11: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Segmentation

• from Shapiro and Stockman figure 10.4 example with K=6, clustering characteristic is RGB color

Page 12: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• Other clustering algorithm are based on using

histograms to cluster• Recall the Otsu method for thresholding

– this is a simple case of clustering into 2 clusters based on greyvalue

Page 13: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• Ohlander, Price and Reddy define a recursive histogram

based clustering algorithm.– an initial image-sized binary mask with all pixels on is

created– do something similar to Otsu on the histogram of the

image pixels that correspond to the on-pixels in the mask– then, perform connected components in each of the

clusters– create an image-sized mask for each connected component

---with on-pixels for the pixels in the connected component and off-pixels elsewhere

– for each mask repeat the above steps until one cluster per mask

Page 14: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Segmentation• figure 10.8 from Shapiro and Stockman

Page 15: CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.

Michael Eckmann - Skidmore College - CS 376b - Spring 2008

Segmentation• Region growing