开发者

casting strel to double in MATLAB

How can I do a cast of strel to double in MATLAB? I tried several casts without success. I couldn'开发者_开发知识库t find anything that worked. thanks for your help.


You need to use the GETNHOOD method of the structuring element:

se = strel('diamond',3)
nhood = se.getnhood
nhood =
     0     0     0     1     0     0     0
     0     0     1     1     1     0     0
     0     1     1     1     1     1     0
     1     1     1     1     1     1     1
     0     1     1     1     1     1     0
     0     0     1     1     1     0     0
     0     0     0     1     0     0     0

%# cast to double
nhood = double(nhood);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜