CS 654 Digital Image Analysis Lecture 26 Image

  • Slides: 45
Download presentation
CS 654: Digital Image Analysis Lecture 26: Image segmentation

CS 654: Digital Image Analysis Lecture 26: Image segmentation

Recap of Lecture 25 • Line detection • Least square, RANSAC • Hough space/

Recap of Lecture 25 • Line detection • Least square, RANSAC • Hough space/ parametric space • Voting • Circle detection • GHT

Outline of Lecture 26 • Thresholding • Otsu’s method • Region based segmentation •

Outline of Lecture 26 • Thresholding • Otsu’s method • Region based segmentation • Region growing • Split and Merge

Introduction • Detected boundaries between regions • Pixel distribution was not exploited • Can

Introduction • Detected boundaries between regions • Pixel distribution was not exploited • Can the regions be segmented directly? • How to exploit the top-down/ bottom-up cues? • Threshold • Region-based segmentation

Thresholding Global thresholding, local thresholding, adaptive thresholding Multiple thresholding

Thresholding Global thresholding, local thresholding, adaptive thresholding Multiple thresholding

Key factors • Separation between peaks • The noise content in the image •

Key factors • Separation between peaks • The noise content in the image • The relative size of the object and the background • Uniformity of the illumination source • Uniformity of the reflectance property of the image Automatic threshold selection

Iterative threshold selection •

Iterative threshold selection •

Optimal thresholding Definition: Methods based on approximation of the histogram of an image using

Optimal thresholding Definition: Methods based on approximation of the histogram of an image using a weighted sum of two or more probability densities with normal distribution.

Example Input image Histogram Segmented image

Example Input image Histogram Segmented image

Otsu’s Image Segmentation Algorithm • Find the threshold that minimizes the weighted within-class variance.

Otsu’s Image Segmentation Algorithm • Find the threshold that minimizes the weighted within-class variance. • Equivalent to: maximizing the between-class variance. • Operates directly on the gray level histogram [e. g. 256 numbers, P(i)] • It is fast (once the histogram is computed).

Otsu: Assumptions • Histogram (and the image) are bimodal. • No use of spatial

Otsu: Assumptions • Histogram (and the image) are bimodal. • No use of spatial coherence, nor any other notion of object structure. • Assumes stationary statistics, but can be modified to be locally adaptive • Assumes uniform illumination (implicitly), so the bimodal brightness behavior arises from object appearance differences only.

Otsu’s method: Formulation The weighted within-class variance is: Where the class probabilities are estimated

Otsu’s method: Formulation The weighted within-class variance is: Where the class probabilities are estimated as: And the class means are given by:

Otsu’s method: Formulation Finally, the individual class variances are: Run through the full range

Otsu’s method: Formulation Finally, the individual class variances are: Run through the full range of t values and pick the value that minimizes Is this algorithm first enough?

Between/ Within/ Total Variance • The total variance does not depend on threshold (obviously).

Between/ Within/ Total Variance • The total variance does not depend on threshold (obviously). • For any given threshold, the total variance is the weighted sum of the within-class variances • The between class variance, which is the sum of weighted squared distances between the class means and the global mean.

Total variance The total variance can be expressed as Within-class, from before Between-class, Minimizing

Total variance The total variance can be expressed as Within-class, from before Between-class, Minimizing the within-class variance is the same as maximizing the between-class variance. compute the quantities in range of t values. recursively as we run through the

Recursive algorithm Initialization. . . Recursion. . . ;

Recursive algorithm Initialization. . . Recursion. . . ;

Example Input image Global thresholding Histogram Otsu’s method

Example Input image Global thresholding Histogram Otsu’s method

Example (in presence of noise) Input image Histogram Global threshold Smoothened image Histogram Otsu’s

Example (in presence of noise) Input image Histogram Global threshold Smoothened image Histogram Otsu’s method

Image partitioning Input image Global Otsu’s Method Histogram Image partitioning Global threshold Local Otsu’s

Image partitioning Input image Global Otsu’s Method Histogram Image partitioning Global threshold Local Otsu’s method

Thresholding (non-uniform background) Input image Global thresholding using Otsu’s method Local thresholding with moving

Thresholding (non-uniform background) Input image Global thresholding using Otsu’s method Local thresholding with moving average

Region based segmentation • Goal: find coherent (homogeneous) regions in the image • Coherent

Region based segmentation • Goal: find coherent (homogeneous) regions in the image • Coherent regions contain pixel which share some similar property • Advantages: Better for noisy images • Disadvantages: Oversegmented (too many regions), Undersegmented (too few regions) • Can’t find objects that span multiple disconnected regions

Types of segmentations Input Oversegmentation Undersegmentation Multiple Segmentations

Types of segmentations Input Oversegmentation Undersegmentation Multiple Segmentations

Region Segmentation: Criteria Homogeneity predicate is satisfied by each region. Union of adjacent regions

Region Segmentation: Criteria Homogeneity predicate is satisfied by each region. Union of adjacent regions does not satisfy it. Define and implement the similarity predicate.

Methods of Region Segmentation • Region growing • Split and merge • Clustering

Methods of Region Segmentation • Region growing • Split and merge • Clustering

Region Growing • It start with one pixel of a potential region • Try

Region Growing • It start with one pixel of a potential region • Try to grow it by adding adjacent pixels till the pixels being compared are too dissimilar • The first pixel selected can be • The first unlabelled pixel in the image • A set of seed pixels can be chosen from the image. • Usually a statistical test is used to decide which pixels can be added to a region

Example Histogram Input image Initial Seed image Final seeds Threshold 1 Threshold 2 Region

Example Histogram Input image Initial Seed image Final seeds Threshold 1 Threshold 2 Region growing Output image

Split and Merge •

Split and Merge •

Example Input image R 1 R 23 R 24 R 32 R 4 R

Example Input image R 1 R 23 R 24 R 32 R 4 R 33 Split R 22 R 1 R 3 R 21 R 34 Split Merge

Quadtree representation R 21 R 23 R 31 R 32 R 33 R 34

Quadtree representation R 21 R 23 R 31 R 32 R 33 R 34 R 3 R 24 R 23 R 24 R 2 R 22 R 1 R 21 R 31 R 4 R 32 R 33 R 34

Clustering • Task of grouping a set of objects • Objects in the same

Clustering • Task of grouping a set of objects • Objects in the same group (called a cluster) are more similar (in some sense or another) to each other • Object of one cluster is different from an object of the another cluster • Connectivity model, centroid model, distribution model, density model, graph based model, hard clustering, soft-clustering, …

Feature Space Source: K. Grauman

Feature Space Source: K. Grauman

Centroid model • Computational time is short • User have to decide the number

Centroid model • Computational time is short • User have to decide the number of clusters before starting classifying data • The concept of centroid • One of the famous method: K-means Method

Partitional Clustering • K-mean algorithm : Decide the number of the final classified result

Partitional Clustering • K-mean algorithm : Decide the number of the final classified result with N. Numbers of cluster: N we now assume N=3

Partitional Clustering • K-mean algorithm : Randomly choose N point for the centroids of

Partitional Clustering • K-mean algorithm : Randomly choose N point for the centroids of cluster. (N=3) Numbers of cluster: N

Partitional Clustering • K-mean algorithm : Find the nearest point for every centroid of

Partitional Clustering • K-mean algorithm : Find the nearest point for every centroid of cluster. Classify the point into the cluster. Notice the definition of th nearest!

Partitional Clustering • K-mean algorithm : Calculate the new centroid of every cluster. Notice

Partitional Clustering • K-mean algorithm : Calculate the new centroid of every cluster. Notice the definition of the centroid!

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the point are classified.

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the point are classified.

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the point are classified.

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the point are classified.

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the

Partitional Clustering • K-mean algorithm : Repeat step 1~ step 4 until all the point are classified.

Partitional Clustering • K-mean algorithm : Data clustering completed For N=3

Partitional Clustering • K-mean algorithm : Data clustering completed For N=3

Example Image Clusters on intensity Clusters on color Slides by D. A. Forsyth

Example Image Clusters on intensity Clusters on color Slides by D. A. Forsyth

Example Input image Segmentation using K-means

Example Input image Segmentation using K-means

Thank you Next Lecture: Image segmentation

Thank you Next Lecture: Image segmentation