Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16...

24
Image Segmentation Image Processing CSE 166 Lecture 17

Transcript of Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16...

Page 1: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Image Segmentation

Image ProcessingCSE 166

Lecture 17

Page 2: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Reading

• Digital Image Processing, 4th edition– Chapter 10: Image segmentation I: edge detection, thresholding, and region detection

CSE 166, Fall 2017 2

Page 3: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Thresholding

CSE 166, Fall 2017 3

Single threshold Dual threshold

Histograms

Page 4: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Noise and thresholding

CSE 166, Fall 2017 4

Noise

Page 5: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Varying background and thresholding

CSE 166, Fall 2017 5

Intensity ramp Product of input and intensity ramp

Input

Page 6: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Basic global thresholding

CSE 166, Fall 2017 6

Intensity ramp ThresholdInput

Page 7: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Optimum global thresholding

CSE 166, Fall 2017 7

Histogram

Basic global thresholding

Optimum global 

thresholding using Otsu’s method

Input

Page 8: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Image smoothing to improve global thresholding

CSE 166, Fall 2017 8

Without smoothing

With smoothing

Otsu’s method

Page 9: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Image smoothing does not always improve global thresholding

CSE 166, Fall 2017 9

Without smoothing

With smoothing

Otsu’s method

Page 10: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Edges to improve global thresholding

CSE 166, Fall 2017 10

Mask image (thresholdedgradient 

magnitude)

Input

Masked input

Optimum global 

thresholding using Otsu’s method

Page 11: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Edges to improve global thresholding

CSE 166, Fall 2017 11

Input

Masked input

Optimum global 

thresholding using Otsu’s method

Mask image (thresholded absolute Laplacian)

Page 12: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Variable thresholding

CSE 166, Fall 2016 12

Global thresholding

Local standard deviations

Local thresholding 

using standard deviations

Input

Page 13: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Variable thresholding

CSE 166, Fall 2016 13

Global thresholding

Local thresholding using moving averages

Input(spot shading)

Page 14: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Variable thresholding

CSE 166, Fall 2016 14

Global thresholding

Local thresholding using moving averages

Input(sinusoidal shading)

Page 15: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Segmentation by region growing

CSE 166, Fall 2017 15

Initial seedimage

InputX‐ray image

Final seed image

Output image

Page 16: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Segmentation by region growing

CSE 166, Fall 2017 16

Difference image thresholded with the smallest of the dual 

thresholds

Segmentation by region growing

Difference image thresholded using dual thresholds

Difference image

Page 17: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Advanced segmentation methods

• k‐means clustering• Superpixels• Graph cuts

CSE 166, Fall 2017 17

Page 18: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Segmentation using k‐means clustering

CSE 166, Fall 2017 18

Input Segmentation using k‐means, k = 3

Page 19: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Superpixels

CSE 166, Fall 2017 19

Image of 4,000 superpixels with 

boundaries

Image of 4,000 superpixels

Input image of 480,000 pixels

Page 20: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Superpixels

CSE 166, Fall 2017 20

500 superpixels 250 superpixels1,000 superpixels

Page 21: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Superpixels for image segmentation

CSE 166, Fall 2017 21

Segmentation using k‐means, k = 3

Superpixel image (100 superpixels)

Input image of 301,678 pixels

Segmentation using k‐means, k = 3

Page 22: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Images as graphs

CSE 166, Fall 2017 22

Simple graph with edges only between 

4‐connected neighbors

Stronger (greater weight) edges are darker

Page 23: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Graph cuts for image segmentation

CSE 166, Fall 2017 23

Cut the weak edges

Page 24: Image Segmentation - Home | Computer ScienceSegmentation by region growing CSE 166, Fall 2017 16 Difference image thresholded with the smallest of the dual thresholds Segmentation

Graph cuts for image segmentation

CSE 166, Fall 2017 24

Smoothed input Graph cut segmentation

Input