strel——structuring element 运用各种形状和大小构造元素,基本语法为
SE = strel(shape, parameters)
shape 是指定希望形状的字符串,parameters 是指定形状信息的一系列参数
SE = strel('arbitrary', NHOOD)
创建一个任意形状的结构元素,NHOOD是由0和1组成的矩阵,用于指定形状可以用se=strel(NHOOD)简化
SE = strel('arbitrary', NHOOD, HEIGHT)
HEIGHT是一个与NHOOD同样大小的矩阵,包含与相关的NHOOD中非零元素的高度值
SE = strel('ball', R, H, N)
creates a nonflat, ball-shaped structuring element (actually an ellipsoid) whose radius in the X-Y plane is R and whose height is H .
When N is greater than 0 , the ball-shaped structuring element is approximated by a sequence of N nonflat, line-shaped structuring elements. When N equals 0 , no approximation is used, and the structuring element members consist of all pixels whose centers are no greater than R away from the origin.
SE = strel('diamond', R)
创建一个平坦的菱形结构元素,R是从结构元素原点到菱形最远的距离
SE = strel('disk', R, N)
创建一个平坦的圆形结构元素,半径为R。
N必须是0,4,6 或8。当N比0大时,圆形结构元素被N个周期线型( periodic-line )结构元素序列近似,当N等于0时,没有近似,结构元素包含所有的小于从原点到R的像素。
se=strel('disk',5,0)
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
se=strel('disk',5,4)
0
0
1
1
1
1
1
0
0
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
0
0
1
1
1
1
1
0
0
SE = strel('line', LEN, DEG)
创建一个平坦的线型结构,LEN长度,DEG角度
SE = strel('octagon', R)
创建一个平坦的八边形结构元素,R是从结构元素原点到八边形边的距离,沿水平轴和垂直轴的度量,R必须是3的非负倍数
SE = strel('pair', OFFSET)
创建一个包含两个成员的平坦结构元素,一个成员在原点,另一个成员由向量OFFSET表示,该向量必须是一个两元素的整数向量
SE = strel('periodicline', P, V)
创建一个包含有2*P+1个成员的平坦元素,其中V是一个两元素向量,它包含有整数值的行和列的偏移,一个元素在原点,另一个位于
1*V, -1*V, 2*V, -2*V, ..., P*V, -P*V.
se=strel('periodicline',2,[1 -2])
0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
SE = strel('rectangle', MN)
创建一个平坦的矩形结构,MN指定大小
SE = strel('square', W)
创建一个方形的结构元素,边长为N个像素
SE = strel(shape, parameters)
shape 是指定希望形状的字符串,parameters 是指定形状信息的一系列参数
SE = strel('arbitrary', NHOOD)
创建一个任意形状的结构元素,NHOOD是由0和1组成的矩阵,用于指定形状可以用se=strel(NHOOD)简化
SE = strel('arbitrary', NHOOD, HEIGHT)
HEIGHT是一个与NHOOD同样大小的矩阵,包含与相关的NHOOD中非零元素的高度值
SE = strel('ball', R, H, N)
creates a nonflat, ball-shaped structuring element (actually an ellipsoid) whose radius in the X-Y plane is R and whose height is H .
When N is greater than 0 , the ball-shaped structuring element is approximated by a sequence of N nonflat, line-shaped structuring elements. When N equals 0 , no approximation is used, and the structuring element members consist of all pixels whose centers are no greater than R away from the origin.
SE = strel('diamond', R)
创建一个平坦的菱形结构元素,R是从结构元素原点到菱形最远的距离
SE = strel('disk', R, N)
创建一个平坦的圆形结构元素,半径为R。
N必须是0,4,6 或8。当N比0大时,圆形结构元素被N个周期线型( periodic-line )结构元素序列近似,当N等于0时,没有近似,结构元素包含所有的小于从原点到R的像素。
se=strel('disk',5,0)
SE = strel('line', LEN, DEG)
创建一个平坦的线型结构,LEN长度,DEG角度
SE = strel('octagon', R)
创建一个平坦的八边形结构元素,R是从结构元素原点到八边形边的距离,沿水平轴和垂直轴的度量,R必须是3的非负倍数
SE = strel('pair', OFFSET)
创建一个包含两个成员的平坦结构元素,一个成员在原点,另一个成员由向量OFFSET表示,该向量必须是一个两元素的整数向量
SE = strel('periodicline', P, V)
创建一个包含有2*P+1个成员的平坦元素,其中V是一个两元素向量,它包含有整数值的行和列的偏移,一个元素在原点,另一个位于
1*V, -1*V, 2*V, -2*V, ..., P*V, -P*V.
se=strel('periodicline',2,[1 -2])
SE = strel('rectangle', MN)
创建一个平坦的矩形结构,MN指定大小
SE = strel('square', W)
创建一个方形的结构元素,边长为N个像素