Download The Image Processing Toolbox User`s Guide

Transcript
bwmorph
Purpose
Syntax
Description
12bwmorph
Perform morphological operations on binary images
BW2 = bwmorph(BW1,operation)
BW2 = bwmorph(BW1,operation,n)
BW2 = bwmorph(BW1,operation) applies a specific morphological operation to
the binary image BW1.
BW2 = bwmorph(BW1,operation,n) applies the operation n times. n can be Inf,
in which case the operation is repeated until the image no longer changes.
operation is a string that can have one of the values listed below.
'bothat'
'erode'
'shrink'
'bridge'
'fill'
'skel'
'clean'
'hbreak'
'spur'
'close'
'majority'
'thicken'
'diag'
'open'
'thin'
'dilate'
'remove'
'tophat'
'bothat' (“bottom hat”) performs binary closure (dilation followed by erosion)
and subtracts the original image.
'bridge' bridges previously unconnected pixels. For example,
1
1
0
0
0
0
0
1
1
becomes
1
1
0
0
1
0
0
1
1
'clean' removes isolated pixels (individual 1’s that are surrounded by 0’s),
such as the center pixel in this pattern.
0
0
0
0
1
0
0
0
0
'close' performs binary closure (dilation followed by erosion).
12-32