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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With