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);
精彩评论