From Pixels to “Blobs” 15-463: Rendering and Image Processing Alexei Efros.

Slides:



Advertisements
Similar presentations
The University of Ontario CS 4487/9587 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.
Advertisements

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:
Chapter 9: Morphological Image Processing
Graph-Based Image Segmentation
Image Segmentation Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 9 Morphological Image Processing Chapter 9 Morphological.
Lecture 6 Image Segmentation
Image segmentation. The goals of segmentation Group together similar-looking pixels for efficiency of further processing “Bottom-up” process Unsupervised.
Computer Vision Group Edge Detection Giacomo Boracchi 5/12/2007
Chapter 9 Morphological Image Processing. Preview Morphology: denotes a branch of biology that deals with the form and structure of animals and planets.
© 2003 by Davi GeigerComputer Vision October 2003 L1.1 Image Segmentation Based on the work of Shi and Malik, Carnegie Mellon and Berkley and based on.
Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
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.
Today: Image Segmentation Image Segmentation Techniques Snakes Scissors Graph Cuts Mean Shift Wednesday (2/28) Texture analysis and synthesis Multiple.
Image Segmentation Today’s Readings Intelligent Scissors, Mortensen et. al, SIGGRAPH 1995Intelligent Scissors From Sandlot ScienceSandlot Science.
Image Segmentation A Graph Theoretic Approach. Factors for Visual Grouping Similarity (gray level difference) Similarity (gray level difference) Proximity.
Image Segmentation Today’s Readings Forsyth & Ponce, Chapter 14
Segmentation and Clustering Today’s Readings Forsyth & Ponce, Chapter 7 (plus lots of optional references in the slides) From Sandlot ScienceSandlot Science.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
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.
Thresholding Thresholding is usually the first step in any segmentation approach We have talked about simple single value thresholding already Single value.
Computer Vision - A Modern Approach Set: Segmentation Slides by D.A. Forsyth Segmentation and Grouping Motivation: not information is evidence Obtain a.
Image Segmentation Selim Aksoy Department of Computer Engineering Bilkent University
Graph-based Segmentation
Image Segmentation Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. 1. into regions, which usually.
Region Segmentation Readings: Chapter 10: 10.1 Additional Materials Provided K-means Clustering (text) EM Clustering (paper) Graph Partitioning (text)
Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals.
Morphological Image Processing
Mathematical Morphology Lecture 14 Course book reading: GW Lucia Ballerini Digital Image Processing.
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
The University of Ontario CS 433/653 Algorithms for Image Analysis Segmentation (2D) Acknowledgements: Alexei Efros, Steven Seitz.
CS 376b Introduction to Computer Vision 02 / 22 / 2008 Instructor: Michael Eckmann.
CSE 185 Introduction to Computer Vision Pattern Recognition 2.
Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007 Digital Image Processing Chapter 9: Morphological Image Processing.
Blending recap Visible seams – edges that should not exist, should be avoided. People are fairly insensitive to uniform intensity shifts or gradual intensity.
Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram
CS654: Digital Image Analysis
Mathematical Morphology Mathematical morphology (matematická morfologie) –A special image analysis discipline based on morphological transformations of.
The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall 2010 Somewhere in Cinque Terre, May 2005 Many slides borrowed from Steve.
Morphological Image Processing การทำงานกับรูปภาพด้วยวิธีมอร์โฟโลจิคัล
Low level Computer Vision 1. Thresholding 2. Convolution 3. Morphological Operations 4. Connected Component Extraction 5. Feature Extraction 1.
Morphological Image Processing Robotics. 2/22/2016Introduction to Machine Vision Remember from Lecture 12: GRAY LEVEL THRESHOLDING Objects Set threshold.
 Mathematical morphology is a tool for extracting image components that are useful in the representation and description of region shape, such as boundaries,
Digital Image Processing Morphological Image Processing.
BYST Morp-1 DIP - WS2002: Morphology Digital Image Processing Morphological Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department.
Morphology Morphology deals with form and structure Mathematical morphology is a tool for extracting image components useful in: –representation and description.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
CS 2750: Machine Learning Clustering Prof. Adriana Kovashka University of Pittsburgh January 25, 2016.
Normalized Cuts and Image Segmentation Patrick Denis COSC 6121 York University Jianbo Shi and Jitendra Malik.
Image Segmentation Today’s Readings Szesliski Chapter 5
Digital Image Processing CP-7008 Lecture # 09 Morphological Image Processing Fall 2011.
Announcements CS accounts Project 1 is out today
Grouping.
CS Digital Image Processing Lecture 5
Lecture 31: Graph-Based Image Segmentation
Announcements Photos right now Project 3 questions
Digital Image Processing
Blending recap Visible seams – edges that should not exist, should be avoided. People are fairly insensitive to uniform intensity shifts or gradual intensity.
Seam Carving Project 1a due at midnight tonight.
Segmentation (continued)
Morphological Operation
Announcements Project 4 questions Evaluations.
Announcements Project 1 is out today
Announcements Project 4 out today (due Wed March 10)
Digital Image Processing Lecture 14: Morphology
Announcements Project 1 is out today help session at the end of class.
“Traditional” image segmentation
Presentation transcript:

From Pixels to “Blobs” : Rendering and Image Processing Alexei Efros

Today Blobs Need for blobs Extracting blobs Image Segmentation Working with binary images Mathematical Morphology Blob properties Further Reading: Gonzalez and Woods, Ch. 9 & 10

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

Blob’s coherence 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 meaning of a blob Other interpretations of blobs are possible, depending on how you define the input image: Image can be a response of a particular detector –Color Detector –Face detector –Motion Detector –Edge Detector gx 2 +gy 2

Why is this useful? AIBO RoboSoccer (VelosoLab)

Ideal Segmentation

Result of Segmentation

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

As Edge Detection gx 2 +gy 2 gx 2 +gy 2 > T

Sometimes works well… What are potential Problems?

…but more often not Adaptive thresholding

Region growing Start with initial set of pixels K Add to K any neighbors, if they are within similarity threshold Repeat until nothing changes Is this same as global threshold? What can go wrong?

Color-Based Blob Segmentation 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

Finding Modes in a Histogram How Many Modes Are There? Easy to see, hard to compute

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

Mean-Shift

Mean-shift results More ExamplesMore Examples:

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

Image Segmentation Detour into Computer Vision… "I stand at the window and see a house, trees, sky. Theoretically I might say there were 327 brightnesses and nuances of colour. Do I have "327"? No. I have sky, house, and trees." --Max Wertheimer From Pixels to Objects, not mere “blobs”… What Defines an Object? Subjective problem, but has been well-studied Gestalt Laws seek to formalize this: –proximity, similarity, continuation, closure, common fate

Region-Based Segmentation We Want Regions why not build this in as a constraint?

q Images as Graphs [Shi & Malik] Graph G = (V, E, W) node for every pixel edge between every pair of pixels, p,q weight w pq for each edge –w pq measures similarity »similarity: difference in color and position (or other things) p w pq w

Segmentation by cutting a Graph Break Graph into Segments Delete edges that cross between segments Easiest to break edges that have low weight: –similar pixels should be in the same segments –dissimilar pixels should be in different segments w ABC

Cuts in a graph Edge Cut set of edges whose removal makes a graph disconnected cost of a cut: A B Normalized Cut a min cut penalizes large segments fix by normalizing for size of segments Vol(A)Vol(B)

The Normalized Cut (NCut) criterion NP-Hard! Given a Graph G = (V, E, W) Find A in V that minimizes

Normalize Cut in Matrix Form

Eigenvalue Problem After lot’s of math, we get: This is a Rayleigh Quotient Solution given by “generalized” eigenvalue problem: Solved by converting to standard eigenvalue problem: Subtleties optimal solution is second smallest eigenvector gives real result—must convert into discrete values of y

Interpretation as a Dynamical System Weights are Springs eigenvectors correspond to vibration modes Movie by Serge Belongie

Interpretation as a Dynamical System Weights are Springs eigenvectors correspond to vibration modes Movie by Serge Belongie

Segmentation result

Color Image Segmentation

Binary Image Processing The result of all these operations is a binary mask Binary images are handy in many cases (sprite extraction, compositing, etc). Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology

Preliminaries

Basic Concepts in Set Theory A is a set in, a=(a 1,a 2 ) an element of A, a  A If not, then a  A  : null (empty) set Typical set specification: C={w|w=-d, for d  D} A subset of B: A  B Union of A and B: C=A  B Intersection of A and B: D=A  B Disjoint sets: A  B=  Complement of A: Difference of A and B: A-B={w|w  A, w  B}=

Preliminaries

Dilation and Erosion Two basic operations: A is the image, B is the “structural element”, a mask akin to a kernel in convolution Dilation : (all shifts of B that have a non-empty overlap with A) Erosion : (all shifts of B that are fully contained within A)

Dilation

Erosion

Original image Eroded image

Erosion Eroded once Eroded twice

Opening and Closing Opening : smoothes the contour of an object, breaks narrow isthmuses, and eliminates thin protrusions Closing : smooth sections of contours but, as opposed to opning, it generally fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps in the contour Prove to yourself that they are not the same thing. Play around with bwmorph in Matlab.

OPENING: The original image eroded twice and dilated twice (opened). Most noise is removed Opening and Closing CLOSING: The original image dilated and then eroded. Most holes are filled.

Opening and Closing

Boundary Extraction

Region Filling

Extraction of Connected Components

First Step : Run Length Encoding Segment each image row into groups of similar pixels called runs Runs store a start and end point for each contiguous row of color Original imageRLE image

Second Step : Merging Regions

Final Results Runs are merged into multi-row regions Image is now described as contiguous regions instead of just pixels

Blob Properties Now that we have nice, clean blobs, what can we do with them? Compute Statistics: Area Perimeter Aspect ratio Center of mass best-fitting ellipse Average color Etc. All this can be used to classify blobs and decide if they hold the objects we are interested in.