Graph-based Segmentation. Main Ideas Convert image into a graph Vertices for the pixels Vertices for the pixels Edges between the pixels Edges between.

Slides:



Advertisements
Similar presentations
MASTERS THESIS By: Rahul Suresh
Advertisements

E.G.M. PetrakisImage Segmentation1 Segmentation is the process of partitioning an image into regions –region: group of connected pixels with similar properties.
Clustering Software Artefacts Based on Frequent common changes Presented by Haroon Malik.
The University of Ontario CS 4487/9587 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.
I Images as graphs Fully-connected graph – node for every pixel – link between every pair of pixels, p,q – similarity w ij for each link j w ij c Source:
Clustering & image segmentation Goal::Identify groups of pixels that go together Segmentation.
Histogram Analysis to Choose the Number of Clusters for K Means By: Matthew Fawcett Dept. of Computer Science and Engineering University of South Carolina.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
Graph-Based Image Segmentation
Stephen J. Guy 1. Photomontage Photomontage GrabCut – Interactive Foreground Extraction 1.
1 s-t Graph Cuts for Binary Energy Minimization  Now that we have an energy function, the big question is how do we minimize it? n Exhaustive search is.
Graph-based image segmentation Václav Hlaváč Czech Technical University in Prague Faculty of Electrical Engineering Department of Cybernetics Prague, Czech.
GrabCut Interactive Image (and Stereo) Segmentation Joon Jae Lee Keimyung University Welcome. I will present Grabcut – an Interactive tool for foreground.
Lecture 6 Image Segmentation
EE 7730 Image Segmentation.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
CS 376b Introduction to Computer Vision 04 / 08 / 2008 Instructor: Michael Eckmann.
Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Text Detection in Video Min Cai Background  Video OCR: Text detection, extraction and recognition  Detection Target: Artificial text  Text.
Segmentation CSE P 576 Larry Zitnick Many slides courtesy of Steve Seitz.
Segmentation Divide the image into segments. Each segment:
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
2010/5/171 Overview of graph cuts. 2010/5/172 Outline Introduction S-t Graph cuts Extension to multi-label problems Compare simulated annealing and alpha-
Stereo & Iterative Graph-Cuts Alex Rav-Acha Vision Course Hebrew University.
Advanced Topics in Computer Vision Spring 2006 Video Segmentation Tal Kramer, Shai Bagon Video Segmentation April 30 th, 2006.
Segmentation Graph-Theoretic Clustering.
MRF Labeling With Graph Cut CMPUT 615 Nilanjan Ray.
Fitting a Model to Data Reading: 15.1,
Stereo Computation using Iterative Graph-Cuts
Perceptual Organization: Segmentation and Optical Flow.
Clustering Unsupervised learning Generating “classes”
Tal Mor  Create an automatic system that given an image of a room and a color, will color the room walls  Maintaining the original texture.
Image Segmentation by Clustering using Moments by, Dhiraj Sakumalla.
Clustering Software Artifacts Based on Frequent common changes Presented by: Ashgan Fararooy Prepared by: Haroon Malik (Modified)
1Ellen L. Walker Segmentation Separating “content” from background Separating image into parts corresponding to “real” objects Complete segmentation Each.
Computer Vision Lecture 5. Clustering: Why and How.
G52IIP, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D Images (Fri) Young Ki Baik, Computer Vision Lab.
G52IVG, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
EECS 274 Computer Vision Segmentation by Clustering II.
CS654: Digital Image Analysis
Compression-based Texture Merging “ Unsupervised Segmentation of Natural Images via Lossy Data Compression ” Allen Y. Yang, John Wright, Shankar Sastry,
Gaussian Mixture Models and Expectation-Maximization Algorithm.
Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.
By Pushpita Biswas Under the guidance of Prof. S.Mukhopadhyay and Prof. P.K.Biswas.
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
A global approach Finding correspondence between a pair of epipolar lines for all pixels simultaneously Local method: no guarantee we will have one to.
Dynamic Programming (DP), Shortest Paths (SP)
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/20/12 “The Double Secret”, Magritte.
Image segmentation.
Clustering [Idea only, Chapter 10.1, 10.2, 10.4].
Grid-Based Genetic Algorithm Approach to Colour Image Segmentation Marco Gallotta Keri Woods Supervised by Audrey Mbogho.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Graph-based Segmentation
Course : T Computer Vision
Cutting Images: Graphs and Boundary Finding
Mean Shift Segmentation
Segmentation Graph-Theoretic Clustering.
Graph Cut Weizhen Jing
Content-Based Image Retrieval
Content-Based Image Retrieval
Lecture 31: Graph-Based Image Segmentation
Seam Carving Project 1a due at midnight tonight.
Announcements Project 4 questions Evaluations.
Midterm Exam Closed book, notes, computer Similar to test 1 in format:
Lecture 14 Minimum Spanning Tree (cont’d)
“Traditional” image segmentation
Presentation transcript:

Graph-based Segmentation

Main Ideas Convert image into a graph Vertices for the pixels Vertices for the pixels Edges between the pixels Edges between the pixels Additional vertices and edges to encode other constraints Additional vertices and edges to encode other constraints Manipulate the graph to segment the image

Papers Interactive graph cuts for optimal boundary & region segmentation of objects in N-D images Boykov and Jolly Boykov and Jolly Minimize an energy function Minimize an energy function Efficient Graph-based Segmentation Felzenszwalb and Huttenlocher Felzenszwalb and Huttenlocher Cluster the vertices based on edge weight Cluster the vertices based on edge weight

Boykov and Jolly Binary image segmentation Classify pixels as object or background Classify pixels as object or background Their contribution is adding interactivity Their contribution is adding interactivity Minimise an energy function E(A) = B(A) + λR(A) E(A) = B(A) + λR(A) A: Segmentation (assign each pixels to object or background) B(A): The cost of all the edges between object pixels and background pixels R(A): The cost of deciding a pixel to be object or background

Creating the Graph Each pixel has a corresponding vertex Additionally, a source (“object”) and a sink (“background”) Each pixel vertex has an edge to its neighbours (e.g. 8 adjacent neighbours in 2D), an edge to the source, an edge to the sink

Edge Weights between pixels Weight of edges between pixel vertices are determined by the B() function Low score when boundary is likely to pass between the vertices high score when vertices are probably part of the same element E.g. the difference in pixel intensities, the gradient

Edges to Source/Sink If pixel is known to be an object, use a high weight (K) to the source, zero weight to the sink K is chosen so that it will never be cut K is chosen so that it will never be cut Conversely, if pixel is background, use weight K to the sink, zero weight to the source Otherwise, weigh edges to source and sink appropriately using the R() function Note that the edge to the source is the “likelihood” for the pixel being the background – we break this edge when the pixel is assigned to the background Note that the edge to the source is the “likelihood” for the pixel being the background – we break this edge when the pixel is assigned to the background

Applications Handles arbitrary number of dimensions Finds global minimum energy Needs “good” user input to work effectively Need intelligent functions Need to select λ

Felzenszwalb and Huttenlocher Download the program from the webpage: Minimal documentation Short README file Short README file Paper Paper

The program Comes as a tar.gz archive and.zip archive Process Extract archive Extract archive ‘make’ (Makefile supplied) ‘make’ (Makefile supplied) Program consists of A.cpp “wrapper” file (only calls the functions) A.cpp “wrapper” file (only calls the functions) Actual algorithm functions are in.h files Actual algorithm functions are in.h files Basic portable C++ code Basic portable C++ code

Program Testing Built on Mac OS X, Linux, Windows cygwin Gcc toolchain, but any C++ compiler should work Gcc toolchain, but any C++ compiler should work Supplied basic Makefile Supplied basic Makefile Results were basically the same between platforms Colors are chosen randomly Colors are chosen randomly Results obtained are not the same as posted on the website Image files on the website may be modified (scaled/compressed/downsampled) Image files on the website may be modified (scaled/compressed/downsampled)

Algorithm Create a graph Each vertex corresponds to a vertex Each vertex corresponds to a vertex Edges are between “neighbouring” vertices Choose a small neighbourhood to reduce computation time (otherwise we have a complete graph) Choose a small neighbourhood to reduce computation time (otherwise we have a complete graph) Weight on the edge is the 5D distance between the points (for a 2D image) Weight on the edge is the 5D distance between the points (for a 2D image) 5D vector = x position, y position and 3 color components

Parameters σ: Use this value and do Gaussian smoothing (preprocessing the image to reduce noise) k: threshold value for doing the clustering min: “hack” parameter the smallest cluster size must contain at least this many vertices – clusters that are too small will be merged with other clusters until sufficiently large the smallest cluster size must contain at least this many vertices – clusters that are too small will be merged with other clusters until sufficiently large

Clustering Put each vertex in a component Sort edges by weight Take each edge in turn If the edge is between vertices in two different components A and B, we can merge if the edge weight is lower enough than the threshold If the edge is between vertices in two different components A and B, we can merge if the edge weight is lower enough than the threshold Threshold is the minimum of the following value, computed on A and B Threshold is the minimum of the following value, computed on A and B (Lowest weight edge in minimum spanning tree of the component) + (k / size of component)

Notes Low edge weights between vertices that are likely to be in the same cluster As a cluster gets larger, it becomes harder to add vertices to it Heuristic – not really minimising a particular energy function More similar to “region growing” More similar to “region growing” User has select “good” parameters to get good results

Effect of σ Increased smoothing results in removal of noise Can cause “bleeding” – the algorithm has difficulty separating background from the object if the boundaries are too smooth

Reference Images

Increasing σ Clouds are recognised as one object Palm tree gets confused with ocean

Grain Increasing σ introduces more blurring (reduces the edge weight between pixels)

Vertebrae MRI Gets rid of noise (bottom left, right hand side), but purple vertebrate piece bleeds out

Increasing Threshold Clusters more aggresively Palm tree is confused with ocean and clouds

Grain Non-grain pixels are almost all clustered together Measure of how “similar” all the pixels of an object should be

MRI Vertebrae and region next to vertebrae are very similar shade so are easily confused

Increasing ‘min’ value Segmentation is the same, but small components are merged with neighboring ones

Grain Easy to control change, gets rid of small artifacts

MRI Not much effect if regions are already large

Parameter Tweaking Need to manually tune parameters to get a good image Image of MRI after selecting σ = 0.6 σ = 0.6 k = 200 k = 200 min = 60 min = 60

Performance Need to tune parameters by hand Very fast Program usually takes a couple seconds on the test images provided Program usually takes a couple seconds on the test images provided Only takes ppm images in RAW data format Theoretically, algorithm generalises to arbitrary number of dimensions and arbitrary number of features per pixel

Command-line tools Working with images involves opening up the results in an image viewer – can get messy