Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

casting strel to double in MATLAB

Tags:

casting

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.

like image 545
tomermes Avatar asked Jun 18 '11 19:06

tomermes


1 Answers

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);
like image 62
Jonas Avatar answered Sep 30 '22 06:09

Jonas