Professional Documents
Culture Documents
Gray-level thresholding! Supervised vs. unsupervised thresholding! Binarization using Otsus method! Locally adaptive thresholding! Maximally stable extremal regions! Color-based segmentation! Region labeling and counting! Region moments!
Gray-level thresholding !
How can holes be lled?!
f [ x, y ] m [ x, y ]
pdf!
Background!
Foreground!
error probability!
Gray level!
Foreground!
error probability!
Gray level!
If different outcomes are associated with different costs: more general Bayes minimimum risk detector!
Unsupervised thresholding !
Idea: nd threshold T that minimizes within-class variance of both foreground and background (same as k-means)!
2 2 between T = 2 within T
()
()
x, yFgrnd
f x, y
2 Fgrnd
N Bgrnd 1 N N Bgrnd
x, yBgrnd
f x, y Bgrnd
2 2
N Fgrnd
()
2 Fgrnd
N Bgrnd
2 Bgrnd
N Fgrnd
N Bgrnd
Bgrnd
()
()
( ))
[Otsu, 1979]!
Bernd Girod: EE368 Digital Image Processing! Image Segmentation no. 5 !
2 between
(T ) =
N Fgrnd T N Bgrnd T N
2
()
( )
Fgrnd
(T ) (T ))
Bgrnd
Fgrnd Bgrnd
( ) () (T + 1) = N (T ) n (T ) N (T ) + n T (T + 1) = N (T + 1) (T ) N (T ) n T (T + 1) = N (T + 1)
Fgrnd Fgrnd T Fgrnd Bgrnd Bgrnd T Fgrnd
[Otsu, 1979]!
Bernd Girod: EE368 Digital Image Processing! Image Segmentation no. 6 !
Original image!
Bernd Girod: EE368 Digital Image Processing!
Slide a window over the image! For each window position, decide whether to do thresholding!
Can use variance or other suitable criterion! Thresholding should not be performed in uniform areas!
Non-uniform areas: apply Otsus method (based on local histogram) ! Uniform areas: classify the entire area as foreground or background based on mean value!
Original image!
Global threshold!
Local threshold!
Extremal region: any connected region in an image with all pixel values above (or below) a threshold! Observations:!
Nested extremal regions result when the threshold is successively raised (or lowered).! The nested extremal regions form a component tree.!
Key idea: choose thresholds such as the resulting bright (or dark) extremal regions are nearly constant when these thresholds are perturbed by +/-
MSERs: illustration !
A+! A!
+! ! -!
A-!
Local minimum of
A A + MSER A
level set
level set
level set
level set
f [x, y] > 0
f [x, y] > 1
f [x, y] > 2
f [x, y] > 3
Image Segmentation no. 14 !
[example from Najman, Couprie, 2006]! Bernd Girod: EE368 Digital Image Processing!
A1 = 8
A2 = 5
A2 = 4
A2 = 4 A3 = 1
A3 = 2
MSER: examples !
Original image !
Chroma keying !
Color is more powerful for pixel-wise segmentation: 3-d vs. 1-d space! Take picture in front of a blue screen (or green, or orange)!
Label categories in training set by hand! Subdivide n-dimensional space into small bins! Count frequency of occurrence for each bin and class in training set, label bin with most probable class! (Propagate class labels to empty bins)! For test data: identify bin, detect the more probable category!
Original image!
To segment image with n components fi, i=1,2,,n into two categories, perform test!
Categories are separated by hyperplane in n-space! Numerous techniques to determine weights see, e.g., [Duda, Hart, Stork, 2001] ! Can be extended to the intersection of several linear discrimant functions! Can be extended to multiple categories!
Bernd Girod: EE368 Digital Image Processing! Image Segmentation no. 21 !
wi, i=0,1,2,,n
after thresholding!
Which pixels belong to the same object (region labeling)?! How large is each object (region counting)?!
Bernd Girod: EE368 Digital Image Processing! Image Segmentation no. 22 !
Denition: a region is a set of pixels, where each pixel can be reached from any other pixel in the region by a nite number of steps, where each step starts at a pixel and ends in the neighborhood of the pixel. !
4-neighborhood!
8-neighborhood!
Typically, leads to the same regions, except when a region is only connected across diagonally adjacent pixels.!
Loop through all pixels f [x,y], left to right, top to bottom! If f [x,y]=0, do nothing.! If f [x,y]=1, distinguish 4 cases!
Copy label from the left. If labels above and to the left ! are different, store ! equivalence. !
Second pass through image to replace equivalent label by the same label.!
Measures the size of each region! Initialize counter[label]=0 for all label
Loop through all pixels f [x,y], left to right, top to bottom! If f [x,y]=0, do nothing.! If f [x,y]=1, increment counter[label[x,y]]
Loop through all pixels f [x,y], left to right, top to bottom! If f [x,y]=0, do nothing.! If f [x,y]=1 and counter[label[x,y]]<S, set f [x,y]=0! Removes all regions smaller than S pixels!
Region Moments !
M pq =
x,yRegion
x p yq
pq =
x,yRegion
(x x ) (y y )
M 10 M 01 with x = and y = M 00 M 00