From Pixels to Blobs

Similar documents
Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Normalized cuts and image segmentation

Announcements. Image Segmentation. From images to objects. Extracting objects. Status reports next Thursday ~5min presentations in class

Morphological Image Processing

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation. Selim Aksoy. Bilkent University

Morphological Image Processing

Targil 12 : Image Segmentation. Image segmentation. Why do we need it? Image segmentation

Morphological Image Processing

EE795: Computer Vision and Intelligent Systems

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

EE 584 MACHINE VISION

CS 534: Computer Vision Segmentation and Perceptual Grouping

Biomedical Image Analysis. Mathematical Morphology

Segmentation and low-level grouping.

Morphological Image Processing

CS 534: Computer Vision Segmentation II Graph Cuts and Image Segmentation

The goals of segmentation

Mathematical Morphology and Distance Transforms. Robin Strand

6.801/866. Segmentation and Line Fitting. T. Darrell

CS4670: Computer Vision

Introduction. Computer Vision & Digital Image Processing. Preview. Basic Concepts from Set Theory

Lecture 7: Segmentation. Thursday, Sept 20

Edges and Binary Images

Morphological Image Processing

Segmentation (Part 2)

Segmentation Computer Vision Spring 2018, Lecture 27

Bioimage Informatics

morphology on binary images

Topic 6 Representation and Description

Clustering appearance and shape by learning jigsaws Anitha Kannan, John Winn, Carsten Rother

Processing of binary images

CITS 4402 Computer Vision

CS4670 / 5670: Computer Vision Noah Snavely

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

Segmentation (continued)

Morphological Image Processing GUI using MATLAB

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

International Journal of Advance Engineering and Research Development. Applications of Set Theory in Digital Image Processing

Unit 3 : Image Segmentation

EE 701 ROBOT VISION. Segmentation

11/10/2011 small set, B, to probe the image under study for each SE, define origo & pixels in SE

ECG782: Multidimensional Digital Signal Processing

Filters. Advanced and Special Topics: Filters. Filters

Announcements. Segmentation (Part 2) Image Segmentation. From images to objects. Image histograms. What do histograms look like?

Segmentation and Grouping

Lecture 11: E-M and MeanShift. CAP 5415 Fall 2007

Content-based Image and Video Retrieval. Image Segmentation

CS 5540 Spring 2013 Assignment 3, v1.0 Due: Apr. 24th 11:59PM

ECG782: Multidimensional Digital Signal Processing

Lecture 7: Morphological Image Processing

Image Segmentation. April 24, Stanford University. Philipp Krähenbühl (Stanford University) Segmentation April 24, / 63

CS 2750: Machine Learning. Clustering. Prof. Adriana Kovashka University of Pittsburgh January 17, 2017

Robot vision review. Martin Jagersand

Image Analysis. Morphological Image Analysis

Segmentation and Grouping

CS443: Digital Imaging and Multimedia Binary Image Analysis. Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University

Solution: filter the image, then subsample F 1 F 2. subsample blur subsample. blur

Image Segmentation continued Graph Based Methods

CS 2770: Computer Vision. Edges and Segments. Prof. Adriana Kovashka University of Pittsburgh February 21, 2017

Connected components - 1

11. Gray-Scale Morphology. Computer Engineering, i Sejong University. Dongil Han

Image Segmentation continued Graph Based Methods. Some slides: courtesy of O. Capms, Penn State, J.Ponce and D. Fortsyth, Computer Vision Book

Segmentation and Grouping April 19 th, 2018

Detection of Edges Using Mathematical Morphological Operators

Digital Image Processing COSC 6380/4393

Image Segmentation. Marc Pollefeys. ETH Zurich. Slide credits: V. Ferrari, K. Grauman, B. Leibe, S. Lazebnik, S. Seitz,Y Boykov, W. Freeman, P.

Outline. Segmentation & Grouping. Examples of grouping in vision. Grouping in vision. Grouping in vision 2/9/2011. CS 376 Lecture 7 Segmentation 1

Morphological Image Processing

Morphology-form and structure. Who am I? structuring element (SE) Today s lecture. Morphological Transformation. Mathematical Morphology

Spectral Clustering on Handwritten Digits Database

Segmentation. Bottom Up Segmentation

Chapter 9 Morphological Image Processing

Object Segmentation. Jacob D. Furst DePaul CTI

Lecture 16 Segmentation and Scene understanding

Digital Image Processing

CS 664 Slides #11 Image Segmentation. Prof. Dan Huttenlocher Fall 2003

Edges and Binary Image Analysis April 12 th, 2018

Grouping and Segmentation

Segmentation and Grouping

Morphological Image Algorithms

Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

2D image segmentation based on spatial coherence

Finger Print Analysis and Matching Daniel Novák

Example 2: Straight Lines. Image Segmentation. Example 3: Lines and Circular Arcs. Example 1: Regions

Example 1: Regions. Image Segmentation. Example 3: Lines and Circular Arcs. Example 2: Straight Lines. Region Segmentation: Segmentation Criteria

[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

Binary Image Analysis. Binary Image Analysis. What kinds of operations? Results of analysis. Useful Operations. Example: red blood cell image

Image Processing (IP) Through Erosion and Dilation Methods

Image Analysis Lecture Segmentation. Idar Dyrdal

Binary Image Processing. Introduction to Computer Vision CSE 152 Lecture 5

Improved image segmentation for tracking salt boundaries

Image Processing and Image Analysis VU

Applications. Foreground / background segmentation Finding skin-colored regions. Finding the moving objects. Intelligent scissors

Introduction to Medical Imaging (5XSA0)

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

human vision: grouping k-means clustering graph-theoretic clustering Hough transform line fitting RANSAC

Clustering Lecture 8. David Sontag New York University. Slides adapted from Luke Zettlemoyer, Vibhav Gogate, Carlos Guestrin, Andrew Moore, Dan Klein

Visual Representations for Machine Learning

Lecture: k-means & mean-shift clustering

Transcription:

From Pixels to Blobs 15-463: 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 1

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 2

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 gx 2 +gy 2 Color Detector Face detector Motion Detector Edge Detector Why is this useful? AIBO RoboSoccer (VelosoLab) 3

Ideal Segmentation Result of Segmentation 4

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 5

Sometimes works well What are potential Problems? but more often not Adaptive thresholding 6

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 7

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 8

Mean-Shift Mean-shift results More Examples: http://www.caip.rutgers.edu/~comanici/segm_images.html 9

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 10

Region-Based Segmentation We Want Regions why not build this in as a constraint? Images as Graphs [Shi & Malik] q p w pq w 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) 11

Segmentation by cutting a Graph w A B C 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 Cuts in a graph A B Edge Cut set of edges whose removal makes a graph disconnected cost of a cut: Normalized Cut a min cut penalizes large segments fix by normalizing for size of segments Vol(A) Vol(B) 12

The Normalized Cut (NCut) criterion Given a Graph G = (V, E, W) Find A in V that minimizes NP-Hard! Normalize Cut in Matrix Form W is the weight matrix : W ( i, j) = wi, D is the sum of weights x is a vector in {1, 1} N from node i :, x( i) = 1 i A. j ; D( i, i) = j W ( i, j); cut(a,b) cut(a,b) Ncut(A,B) = + Vol(A) Vol(B) T T (1 + x) ( D W)(1 + x) (1 x) ( D W)(1 x) = + ; T T k1 D1 (1 k)1 D1 k = xi > 0 i D( i, i) D( i, i) 13

Eigenvalue Problem After lot s of math, we get: T y (D W)y T Ncut( A, B) =, with y {1, }, y D1 = 0. T i b y Dy This is a Rayleigh Quotient Solution given by generalized eigenvalue problem: Solved by converting to standard eigenvalue problem: Subtleties 1 (D W)y = λdy 1 2 2 2 D (D W)D z = λ z, where z = D y optimal solution is second smallest eigenvector gives real result must convert into discrete values of y 1 Interpretation as a Dynamical System Weights are Springs eigenvectors correspond to vibration modes Movie by Serge Belongie 14

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

Color Image Segmentation balus_movie.mpg 16

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 17

Preliminaries Preliminaries 18

Basic Concepts in Set Theory Z 2 A is a set in, a=(a1,a2) 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: A c = {w w A} Difference of A and B: A-B={w w A, w B}= A B c Preliminaries Bˆ = { w w = b, for ( A) z = { c c = a + z, b B} for a A} 19

Dilation and Erosion Two basic operations: A is the image, B is the structural element, a mask akin to a kernel in convolution Dilation : ) A B = { z ( B) z A φ} ) A B = { z [( B) A] A} z (all shifts of B that have a non-empty overlap with A) Erosion : A Θ B = { z ( B) A} z (all shifts of B that are fully contained within A) Dilation 20

Dilation Erosion 21

Erosion Original image Eroded image Erosion Eroded once Eroded twice 22

Opening and Closing Opening : smoothes the contour of an object, breaks narrow isthmuses, and eliminates thin protrusions A o B = ( AΘ B ) B 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 A B = ( A B ) Θ B Prove to yourself that they are not the same thing. Play around with bwmorph in Matlab. Opening and Closing OPENING: The original image eroded twice and dilated twice (opened). Most noise is removed CLOSING: The original image dilated and then eroded. Most holes are filled. 23

Opening and Closing Boundary Extraction β ( A) = A ( AΘB) 24

Boundary Extraction Region Filling X k c = ( X 1 B) I A k = 1,2,3... k 25

Extraction of Connected Components X k = ( X 1 B) I A k = 1,2,3,... k 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 image RLE image 26

Second Step : Merging Regions Final Results Runs are merged into multi-row regions Image is now described as contiguous regions instead of just pixels 27

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. 28