Top Banner
Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012
38

Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Jan 03, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Image Segmentation and Morphological Processing

Digital Image Processing in Life- ScienceAviad Baram 4-4-2012

Page 2: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Image In Attributesout

Image In Image out

Processing vs Analysis

Image processing:

Image analysis:

EnhancecontrastSmooth

RegionEdges“meaning”

Page 3: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Part I - Segmentation

Subdivide the image into constituent regions or objects (sets)

Based on properties of intensity values

▪ Discontinuity – changes (e.g. edges)

▪ Similarity – partition into similar regions

∑i=1

n

Ri=R Q (Ri )≠Q (R j )

Page 4: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Basic set operations

Union (Rr∪Rg)Complementary (Rrgc)Intersect (Rr∩Rg)Exclusive or (Rr⊕Rg)

Page 5: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Synonyms in set operations

Selection

ROI

Make Inverse

OR (Combine)

AND

XOR

Mathematical

Set (Ri)

Complementary (Ric)

Union (Ri∪Rj)

Intersect (Ri∩Rj)

Exclusivedisjunction (Ri⊕Rj)

BinaryMask

Inverse

OR

AND

XOR

Page 6: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Automatic approaches

■ Discontinuity – Edge based methods■ Classical gradient detectors (Sobel, Prewitt...)■ Canny edge detector

■ Similarity - threshold

Why?Human comprehension is far superior UnbiasedHigh throughput – ImageJ macros

Page 7: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Edge detection

Find the boundary of a region by identifying points, lines and edges

Tools:

▪ Second derivatives (Laplacian) operators

▪ Very sensitive to noise

▪ Double line detection (show example)

▪ First derivative

▪ Smoother

▪ Less sensitive

Page 8: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Derivatives noise

First derivative Second derivative

Page 9: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Derivatives noise

First derivative Second derivative

Page 10: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Derivatives noise

First derivative

Second derivative

Page 11: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Laplacian double edge

Page 12: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Prewitt and Sobel

Derivative Sobel

-1

-2 0

1

210

0

-1

Page 13: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Laplacian of Gaussian - LoG

Laplacian LoG

Page 14: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Canny edge detector

angle

norm

Nonmaxima suppression along gradient

Double threshold → use TH edge pixelsas seeds to connect TL edges

Page 15: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Edge detection Summary

1st derivative 2nd derivative Source

LoGSobel Canny

Page 16: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Similarity - Threshold

Partition Image into regions

▪ Global threshold

▪ Adaptive threshold

▪ Smaller image blocks

▪ Threshold for each blocks

▪ Interpolate results for each pixels

Page 17: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Global threshold - noise

g ( x,y )={a iff ( x,y )>T 2b ifT1<f ( x,y )≤T 2

c iff ( x,y )≤T 1}

T1

T2

abc

Page 18: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Global threshold - background

Page 19: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Automatic global threshold

Example 1 - mean:

Initial estimatefor T

Segment into G1 and G2

Compute meanfor G1 and G2

Compute new thresholdT=

12 ( ⟨G1⟩+ ⟨G2⟩ )

G1 G2

⟨G1⟩ ⟨G2⟩

Repeat until no significant change

Page 20: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Automatic global thresholdExample 2 – Otsu: minimize error in pixelassignment to groups

Global mean: mG

Global variance: σ2G

mean1 mean2

Between-class variance: σ2B

η=σ B

2

σG2

“goodness” of TH:

Calculate for allthresholds and choosethe max σ2

B

smoothing imagesimproves auto segmentation

Page 21: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Local thresholding

Calculate T from “subimage” histogram (e.g. edges...) ⇒ apply to full image

Page 22: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Variable thresholding

For each pixel, f(x,y), compute a threshold, Txy, based on mxy and σxy of neighborhood Sxy

Meanm - mean σ - variance

T xy=aσ xy+bm xy

T xy=aσ xy+bmG

g ( x,y )={1 iff ( x,y )>T xy0 iff ( x,y )≤T xy }

Page 23: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Part II - Morphology

Processing of region shapes

Page 24: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Structuring Elements

Page 25: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Erosion

A B⊖

Page 26: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Erosion

Remove connecting linesShrink regions

Page 27: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Dilation

A B⊕

Page 28: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Dilation

Bridge gapsGrow regions

Dilate⇔ErodeC

Page 29: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Open

A◦B

Smooth contourBreak narrow bridgesEliminate protrusions

nX Erode → n X dilate

Page 30: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Close

A•B

Smooth contourFuse narrow breaksEliminate small holesFills gaps

nX dilate → n X erode

Open⇔CloseC

Page 31: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Boundary extraction

Subtract the eroded image from original

Page 32: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Skeletons

Minimal set required for reconstruction

ImageJ built in function – erode to single pixel

Page 33: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Fill holes

Hole – background region surrounded by a foreground connected border

Page 34: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Hit or Miss

A B=(A B⊛ ⊖1)∩(AC B⊖

2)

Shape detection

Probe for object

Probe for background

Page 35: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Watershed

ImageJ built inSegmentationGray level

Page 36: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

ImageJ Set Measurement...

Page 37: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Gray level morphology

Erode DilateOpen Close

Page 38: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012.

Examples

Yael Mutsafi Ayelet Tetelboim