What units is the number in strel('disk', 22)?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Simran Parkhe
el 16 de Sept. de 2019
dilated = imdilate(ImagetoDilate,strel('disk', 22));
I have this line in my code to dilate the image, but I was wondering what units the 22 is? It says it is the radius but is it measured in centimeters, percentage, pixels or something else?
0 comentarios
Respuesta aceptada
Walter Roberson
el 16 de Sept. de 2019
Editada: Walter Roberson
el 16 de Sept. de 2019
Pixels.
Or more correctly, memory locations, as the result is used in multiple contexts and makes no attempt to handle multiple color planes.
1 comentario
Guillaume
el 16 de Sept. de 2019
Editada: Guillaume
el 16 de Sept. de 2019
You can easily look at the structuring element
>> s = strel('disk', 22)
s =
strel is a disk shaped structuring element with properties:
Neighborhood: [43×43 logical]
Dimensionality: 2
and you can see that the disk overlaps 43x43 pixels.
As for it being a disk:
>> imagesc(s.Neighborhood); colormap([0 0 0; 0.8 0.8 0.8]); axis('off')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/238525/image.png)
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!