The University of Ontario CS 433/653 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.

Slides:



Advertisements
Similar presentations
MASTERS THESIS By: Rahul Suresh
Advertisements

November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/15/11 “The Double Secret”, Magritte.
Graphs: MSTs and Shortest Paths David Kauchak cs161 Summer 2009.
The University of Ontario CS 4487/9587 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.
CSE 380 – Computer Game Programming Pathfinding AI
Kapitel 13 “Interactive Segmentation” – p. 1 Interactive Segmentation  Live-wire approach  Random walker segmentation TexPoint fonts used in EMF. Read.
Graph-based image segmentation Václav Hlaváč Czech Technical University in Prague Faculty of Electrical Engineering Department of Cybernetics Prague, Czech.
Active Contours (SNAKES) Back to boundary detection –This time using perceptual grouping. This is non-parametric –We’re not looking for a contour of a.
Segmentation and Region Detection Defining regions in an image.
Lecture 6 Image Segmentation
EE 7730 Image Segmentation.
Segmentation and Clustering. Segmentation: Divide image into regions of similar contentsSegmentation: Divide image into regions of similar contents Clustering:
Segmentation CSE P 576 Larry Zitnick Many slides courtesy of Steve Seitz.
Segmentation Divide the image into segments. Each segment:
Announcements Project 2 more signup slots questions Picture taking at end of class.
CS 206 Introduction to Computer Science II 11 / 10 / 2008 Instructor: Michael Eckmann.
Today: Image Segmentation Image Segmentation Techniques Snakes Scissors Graph Cuts Mean Shift Wednesday (2/28) Texture analysis and synthesis Multiple.
From Pixels to “Blobs” : Rendering and Image Processing Alexei Efros.
Snakes Goes from edges to boundaries. Edge is strong change in intensity. Boundary is boundary of an object. –Smooth (more or less) –Closed. –…
Image Segmentation Today’s Readings Intelligent Scissors, Mortensen et. al, SIGGRAPH 1995Intelligent Scissors From Sandlot ScienceSandlot Science.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Image Segmentation Today’s Readings Forsyth & Ponce, Chapter 14
Announcements Mailing list: –you should have received messages Office hours onlineonline –start next week.
Segmentation and Clustering Today’s Readings Forsyth & Ponce, Chapter 7 (plus lots of optional references in the slides) From Sandlot ScienceSandlot Science.
CS292 Computational Vision and Language Segmentation and Region Detection.
Announcements vote for Project 3 artifacts Project 4 (due next Wed night) Questions? Late day policy: everything must be turned in by next Friday.
Announcements Project 3 questions Photos after class.
Image Segmentation Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. 1. into regions, which usually.
Computer Vision James Hays, Brown
Graph-based Segmentation. Main Ideas Convert image into a graph Vertices for the pixels Vertices for the pixels Edges between the pixels Edges between.
1Ellen L. Walker Segmentation Separating “content” from background Separating image into parts corresponding to “real” objects Complete segmentation Each.
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
CSE 185 Introduction to Computer Vision Pattern Recognition 2.
Intelligent Scissors for Image Composition Anthony Dotterer 01/17/2006.
Lecture 4: Image Resampling and Reconstruction CS4670: Computer Vision Kavita Bala.
Chapter 10 Image Segmentation.
CS 4487/6587 Algorithms for Image Analysis
EECS 274 Computer Vision Segmentation by Clustering II.
Connected Components Fun with graphs, searching, and queues.
CS654: Digital Image Analysis Lecture 30: Clustering based Segmentation Slides are adapted from:
CS654: Digital Image Analysis
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Edge Detection:
CSSE463: Image Recognition Day 23 Midterm behind us… Midterm behind us… Foundations of Image Recognition completed! Foundations of Image Recognition completed!
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/20/12 “The Double Secret”, Magritte.
The University of Ontario The University of Ontario 5-1 CS 4487/9587 Algorithms for Image Analysis Segmentation with Boundary Regularization Acknowledgements:
Graph-based Segmentation
Graphcut Textures:Image and Video Synthesis Using Graph Cuts
Cutting Images: Graphs and Boundary Finding
Announcements CS accounts Project 1 is out today
CSSE463: Image Recognition Day 21
COMP 9517 Computer Vision Segmentation 7/2/2018 COMP 9517 S2, 2017.
CS4670/5670: Image Scissors Noah Snavely Today’s Readings
Mean Shift Segmentation
Minimum Spanning Tree.
CSSE463: Image Recognition Day 23
Announcements Reader is in the BOOK STORE (not Comm Bldg.)
Announcements Photos right now Project 3 questions
Seam Carving Project 1a due at midnight tonight.
Segmentation (continued)
Announcements Project 1 is out today
CSSE463: Image Recognition Day 23
Announcements Project 4 out today (due Wed March 10)
Announcements Project 1 is out today help session at the end of class.
CSSE463: Image Recognition Day 23
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

The University of Ontario CS 433/653 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz

The University of Ontario CS 433/653 Algorithms for Image Analysis Segmentation (2D) n Blobs Need for blobs Extracting blobs –Thresholding, region growing, mean-shift –Minimum spanning trees n Object extraction Intelligent scissors (also known as live-wire) Snakes Region+boundary methods n Local, greedy, and global processing Extra Reading: Sonka at.al. Ch. 5 Gonzalez and Woods, Ch. 10

The University of Ontario HW assignment 1 n 2D image segmentation Live-wire (based on Dijkstra algorithm for shortest paths on a graph) Implement and experiment on two images Bonus for comparing with local/greedy methods Some useful code libraries and sample images will be posted within a couple of days

The University of Ontario Goal: Extract “Blobs” n What are “blobs”? Regions of an image that are somehow coherent n Why? Object extraction, object removal, compositing, etc. …but are “blobs” objects? No, not in general

The University of Ontario Blob’s coherence n Simplest way to define blob coherence is as similarity in brightness or color: The tools become blobs The house, grass, and sky make different blobs

The University of Ontario Why is this useful? AIBO RoboSoccer (VelosoLab)

The University of Ontario Ideal Segmentation

The University of Ontario Result of Segmentation

The University of Ontario Thresholding n Basic segmentation operation: mask(x,y) = 1 if im(x,y) > T mask(x,y) = 0 if im(x,y) < T n T is threshold User-defined Or automatic n Same as histogram partitioning:

The University of Ontario Sometimes works well… What are potential Problems?

The University of Ontario …but more often not Adaptive thresholding

The University of Ontario Region growing n Is this same as global threshold? Start with initial set of pixels K (initial seed(s)) Add to pixels p in K their neighbors q if |Ip-Iq| < T Repeat until nothing changes

The University of Ontario Region growing

The University of Ontario What can go wrong with region growing ? Region growth may “leak” through a single week spot in the boundary

The University of Ontario Region growing See region leaks into sky due to a weak boundary between them

The University of Ontario Due to Pedro Felzenszwalb and Daniel Huttenlocher Motivating example This image has three perceptually distinct regions Difference along border between A and B is less then differences within C A CB Q: Where would image thresholding fail? Q: Where would region growing fail? A: Region A would be divided in two sets and region C will be split into a large number of arbitrary small subsets A: Either A and B are merged or region C is split into many small subsets Also, B and C are merged

The University of Ontario Color-Based Blob Segmentation n Automatic Histogram Partitioning Given image with N colors, choose K Each of the K colors defines a region –not necessarily contiguous Performed by computing color histogram, looking for modes This is what happens when you downsample image color range, for instance in Photoshop

The University of Ontario Finding Modes in a Histogram n How Many Modes Are There? Easy to see, hard to compute

The University of Ontario Mean Shift [ Comaniciu & Meer] 1.Initialize random seed, and fixed window 2.Calculate center of gravity ‘x’ of the window (the“mean”) 3.Translate the search window to the mean 4.Repeat Step 2 until convergence Iterative Mode Search x o x x mode

The University of Ontario Mean-Shift

The University of Ontario Mean-shift results More ExamplesMore Examples:

The University of Ontario Issues: n Although often useful, all these approaches work only some of the time, and are considered rather “hacky”. n Can’t even handle our tiger: Problem is that blobs != objects!

The University of Ontario Extracting objects n How could this be done?

The University of Ontario Extracting objects n Many approaches proposed color cues region cues contour cues n We will consider a few of these n Today: Intelligent Scissors (contour-based) –E. N. Mortensen and W. A. Barrett, Intelligent Scissors for Image Composition, in ACM Computer Graphics (SIGGRAPH `95), pp , 1995Intelligent Scissors for Image Composition

The University of Ontario Intelligent Scissors

The University of Ontario Intelligent Scissors n Approach answers a basic question Q: how to find a path from seed to mouse that follows object boundary as closely as possible? A: define a path that stays as close as possible to edges

The University of Ontario Intelligent Scissors n Basic Idea Define edge score for each pixel –edge pixels have low cost Find lowest cost path from seed to mouse seed mouse Questions How to define costs? How to find the path?

The University of Ontario Path Search (basic idea) n Graph Search Algorithm Computes minimum cost path from seed to all other pixels Note: diagonal “paths” are scaled by a factor. … Why?

The University of Ontario Good segmentation method should have Invariance to Image Rotation After object rotation L L Path’s cost along the top boundaryPath’s cost along the top-left boundary After diagonal links are adjusted by image gradient scores

The University of Ontario Instead of nodes, image gradient scores can be assigned directly to graph edges n Graph node for every pixel p link between every adjacent pair of pixels, p,q cost c for each link n Note: each link has a cost this is a little different than the figure before where each pixel (graph node) had a cost p q c n Treat the image as a graph

The University of Ontario Defining the costs n Treat the image as a graph n Want to hug image edges: how to define cost of a link? p q c the link should follow the intensity edge –want intensity to change rapidly to the link c  - |difference of intensity to the link| T T

The University of Ontario Defining the costs p q c n c can be computed using a cross-correlation filter assume it is centered at p n Also typically scale c by its length set c = (max-|filter response|) –where max = maximum |filter response| over all pixels in the image

The University of Ontario Defining the costs p q c 1 w 11 n c can be computed using a cross-correlation filter assume it is centered at p n Also typically scale c by its length set c = (max-|filter response|) –where max = maximum |filter response| over all pixels in the image Why no scalar?

The University of Ontario (see Cormen et.al. “Introduction to Algorithms”, p.595) Dijkstra’s shortest path algorithm link cost 1.init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) ALGORITHM

The University of Ontario Dijkstra’s shortest path algorithm init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) –if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there) ALGORITHM

The University of Ontario Dijkstra’s shortest path algorithm init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) –if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there) 3.set r = node with minimum cost on the ACTIVE list 4.repeat Step 2 for p = r ALGORITHM

The University of Ontario Dijkstra’s shortest path algorithm init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) –if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there) 3.set r = node with minimum cost on the ACTIVE list 4.repeat Step 2 for p = r ALGORITHM

The University of Ontario Dijkstra’s shortest path algorithm init node costs to , set p = seed point, cost(p) = 0 2.expand p as follows: for each of p’s neighbors q that are not expanded set cost(q) = min( cost(p) + c pq, cost(q) ) –if q’s cost changed, make q point back to p put q on the ACTIVE list (if not already there) 3.set r = node with minimum cost on the ACTIVE list 4.repeat Step 2 for p = r ALGORITHM

The University of Ontario Path Search (basic idea) A B Dijkstra algorithm - processed nodes (distance to A is known) - active nodes (front) - active node with the smallest distance value

The University of Ontario Dijkstra’s shortest path algorithm n Properties It computes the minimum cost path from the seed to every node in the graph. This set of minimum paths is represented as a tree Running time, with N pixels: –O(N 2 ) time if you use an active list –O(N log N) if you use an active priority queue (heap) –takes < second for a typical (640x480) image Once this tree is computed once, we can extract the optimal path from any point to the seed in O(N) time. –it runs in real time as the mouse moves What happens when the user specifies a new seed?

The University of Ontario Livewire extensions n Directed graphs n Restricted search space Restricted domain (e.g. near a priori model) Restricted backward search n Different edge weight functions Image-Edge strength Image-Edge Curvature Proximity to known approximate model/boundary n Multi-resolution processing

The University of Ontario Results