Interactive Image Cutout- Lazy Snapping Hu Junfeng 2015-11-25 “Lazy Snapping”, SIGGRAPH 2004 Yin Li, Jian Sun, Chi-Keung Tang, Heung-Yeung Shum
Interactive image cutout Lazy snapping Demo Grabcut Image cutout is the technique of removing an object from its background
Interactive image cutout Lazy snapping Demo Grabcut Image cutout is the technique of removing an object from its background
Lazy snapping Step 1: a quick object marking step Work at a coarse scale Specifies the object of interest by a few marking lines Step 2: a simple boundary editing step Work at a finer scale Edit the object boundary by simply clicking and dragging polygon vertices
Object marking UI design Representative clustering centers Two groups of lines for the representative parts of foreground and background Representative clustering centers K-means method to obtain 64 clusters for each class : for foreground : for background
K-means clustering Iterating the 4 steps below Seed initialization Assigning elements Seed updating Assigning again
Object marking Foreground/background image segmentation A typical graph-cut problem Intuition: classifying the pixels into two groups, which has the Similar feature in this group; each group has the smoothness assumption, a Commonly used prior knowledge
Graph cut image segmentation An image cutout problem can be posed as a binary labelling problem on a graph G=(V, E) V: the nodes represent all the pixels E: the edge linking two neighboring pixels (4-neighborhood) i: the i-th node Background Foreground Edge
Graph cut image segmentation Corresponding to above 2 intuitive steps Define the likelihood energy : Define the prior energy : Minimize the above two terms simultaneously Encoding the cost when the label of node i is xi The smaller, the better Encoding the cost when the label of node i and node j is xi and xj The smaller, the better
Graph cut image segmentation The likelihood energy The prior energy
Graph cuts Min cut == Max flow
Max flow problem Bottleneck problem General algorithms: Ford-Fulkerson algorithm, push-relabel maximum flow new algorithm by Boykov, etc
Boundary editing Boundary as editable polygon UI design/Tools First vertex – border pixel with highest curvature Next vertices: furthest boundary pixel from previous polygon Stop when distance is below some threshold UI design/Tools Direct vertex editing Overriding brush Using graph cuts
Experimental results
分组大作业 Project 1 彩色直方图均衡优化 1人组 时间:12月11号 Project 2 图像分割 2人组 提交时间:12月11号