How do i transform/convert a structuring element to an binary image in Matlab?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How do i transform/convert a structuring element to an binary image in Matlab? For example, say i need to convert a square structuring element
se = strel('square',7)
Kindly help me in this matter, i really need a method. Thank you
0 comentarios
Respuesta aceptada
Jeff E
el 11 de Nov. de 2013
>> se = strel('square',7);
>> nhood = getnhood(se);
>> whos('se' ,'nhood')
Name Size Bytes Class Attributes
nhood 7x7 49 logical
se 1x1 112 strel
0 comentarios
Más respuestas (1)
Roro
el 11 de Nov. de 2013
1 comentario
Jeff E
el 11 de Nov. de 2013
Editada: Jeff E
el 11 de Nov. de 2013
I'm not sure I can explain the syntax any better than the help, but in this specific instance you need to give the radius of the disk, not the total width/height like you do with square. So, for the first graphic try 5 or 6 instead of 10.
For the second two, it looks like they used a non-default approximation to get a smoother circle. Something like this:
se = strel('disk', 10, 8);
As usual, Steve Eddins has a great blot post about how Matlab decomposes structuring elements to improve performance: http://blogs.mathworks.com/steve/2008/09/17/dilation-structuring-element-decomposition//
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!