image segmentation and morphological processing digital image processing in life- science aviad...
TRANSCRIPT
![Page 1: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/1.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/8.jpg)
Derivatives noise
First derivative Second derivative
![Page 9: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/9.jpg)
Derivatives noise
First derivative Second derivative
![Page 10: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/10.jpg)
Derivatives noise
First derivative
Second derivative
![Page 11: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/11.jpg)
Laplacian double edge
![Page 12: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/13.jpg)
Laplacian of Gaussian - LoG
Laplacian LoG
![Page 14: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/14.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/16.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/18.jpg)
Global threshold - background
![Page 19: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/19.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/20.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/21.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/22.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/23.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/24.jpg)
Structuring Elements
![Page 25: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/25.jpg)
Erosion
A B⊖
![Page 26: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/26.jpg)
Erosion
Remove connecting linesShrink regions
![Page 27: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/27.jpg)
Dilation
A B⊕
![Page 28: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/28.jpg)
Dilation
Bridge gapsGrow regions
Dilate⇔ErodeC
![Page 29: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/29.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/30.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/31.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/32.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/33.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/34.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/35.jpg)
Watershed
ImageJ built inSegmentationGray level
![Page 36: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/36.jpg)
ImageJ Set Measurement...
![Page 37: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/37.jpg)
Gray level morphology
Erode DilateOpen Close
![Page 38: Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram 4-4-2012](https://reader035.vdocuments.mx/reader035/viewer/2022062221/56649f035503460f94c17334/html5/thumbnails/38.jpg)
Examples
Yael Mutsafi Ayelet Tetelboim