syde 575: digital image processing image segmentation part i: histogram methods chapter 10

25
SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Upload: charlotte-ball

Post on 17-Dec-2015

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

SYDE 575: Digital Image Processing

Image Segmentation Part I: Histogram Methods

Chapter 10

Page 2: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Computer Vision Process

Acquisition

Enhancement /

Restoration Segmentation

Enhancement /

Restoration Classification

Scene

Information

Page 3: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

What is Segmentation?

Underlying goal of image segmentation is to partition an image into homogeneous regions

Source: The MathWorks

Page 4: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Why segment?

Segmentation allows objects and regions to be analysed in a more meaningful manner

Some applications of segmentation: Object tracking (e.g., people tracking for

surveillance purposes) Medical image analysis (e.g., tumor growth

analysis) Remote sensing analysis (e.g., determine the

ratio of different types of sea-ice within a region) Face recognition (e.g., partition face into

individual parts for component recognition)

Page 5: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Bottom-Up vs Top-Down

• Bottom-Up Segmentation: – Segment image into regions and then identify those

regions that correspond to a single object– Uses features such as consistent grey level or texture

and/or identification of boundaries to identify the object

• Top-Down Segmentation:– Uses prior knowledge of the object (e.g., shape, color,

texture) to guide segmentation

• Example: identify all cows in an image database

Page 6: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Mathematical Definition

Ri is a region i.e., a closed, interconnected set of pixels.

a) Union of all regions Ri represents the full image.

b) All Ri represent a connected set.

c) Intersection of any Ri and Rj pair is a null set.

d) All pixels within Ri must satisfy some common property.

e) Spatially adjacent Ri (i.e., touching) must be different with respect to some property.

Page 7: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Types of Segmentation Algorithms

Segmentation algorithm groupings:I. Histograms / Clustering

II. Edge-based

III. Region-based

IV. Advanced

Page 8: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

I. Histogram Segmentation

Simplest and computationally efficient form of segmentation

Consider image histogram

Page 9: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Histogram Segmentation

Analyze peaks of the histogram to determine appropriate point for thresholding

peak peak

peak

Page 10: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Histogram Segmentation

Goal: Determine an appropriate point of thresholding based on what we want (e.g., segment foreground and background)

Threshold

Page 11: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Histogram Segmentation

Set all pixels to a set of fixed values based on threshold

Binary thresholding in example below

Page 12: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Problems With Finding a Threshold

1. Histogram is typically noisy so difficult to isolate an appropriate T automatically

2. Peaks may not be noticeable due to noisy appearance and large class variances (may even appear unimodal)

3. Illumination differences across image makes setting a global threshold erroneous (i.e., non-stationarity problem)

4. Regions may be discriminable using other descriptors e.g., texture

Page 13: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Possible Solutions

A. Otsu’s method: use statistics from histogram to find threshold. Next: derive Otsu’s method

B. Use “clustering” i.e. use criterion to group pixels into appropriate classes e.g., k-means algorithm. Also, see SD372 – Pattern Recognition.

C. Use method that accounts for spatial (within-image) relationships e.g., Markov random fields [Advanced – we won’t cover.]

Page 14: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Derive Otsu’s Equation

• See blackboard

Page 15: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Otsu’s Method - Example

Page 16: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Smoothing + Otsu’s Method

Page 17: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Clustering-Based Segmentation: K-means

Create partitions by grouping pixels into clusters

Steps for K-means (“migrating means”) clustering:1. Pick K pixels to act as the initial centers of

the K clusters2. Assign each pixel to one cluster based on

minimum Euclidean distance3. If no pixels change clusters STOP; otherwise,

recalculate cluster means based on new pixel assignments

4. Return to Step 2.

Page 18: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

K-means Example

webdocs.cs.ualberta.ca/~nray1/CMPUT466_551/Clustering.ppt

• Three class segmentation

Page 19: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Finite Mixture Models

Suppose we know that there are m clusters/classes in the image

Suppose that the probability distribution of each cluster/class can be modeled using a parametric model (e.g., Gaussian, Gamma, Cauchy, etc.)

Idea: We can model the probability distribution of the image as a mixture of m different probability distributions, one for each cluster/class

Page 20: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Finite Mixture Models

Formulation:

Goal: Determine this set of m distributions and determine which pixel values belong to each cluster/class based on which of these distributions give the highest probability

Page 21: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Finite Mixture Models

Example

6 8 10 12 14 16 18 20 22 240

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

Cluster 1 Cluster 2

Page 22: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Finite Mixture Models

Steps: Learn the parameters of the distribution

models for the m clusters e.g., for Gaussian, learn the mean and standard

deviation For each possible pixel

1. Determine the probability that its pixel intensity belongs to each of the m clusters based on the distribution models

2. Assign the pixel's cluster label to the cluster that provides the highest probability

Therefore, thresholds between clusters coincide at points of equal probabilities

Page 23: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Finite Mixture Models

Example: Suppose we have two classes, modeled by two Gaussians (u1=3, σ1=1, u2=5, σ2=1)

What is the threshold between these two classes?

Set up distribution equations for each class

Page 24: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Finite Mixture Models

Since threshold is at point of equal probabilities:

Page 25: SYDE 575: Digital Image Processing Image Segmentation Part I: Histogram Methods Chapter 10

Histogram Segmentation

Advantages: Efficient (usually requires only one pass for

simple segmentation cases) Good for multiple distinct partitions in histogram

Disadvantages: Often difficult to determine proper peaks in the

histogram Difficult in situations where intensity is not

sufficient to distinguish between two partitions (e.g., textured regions containing different mixes of intensities)

No spatial context