MATLAB Answers

0

What units is the number in strel('disk', 22)?

Asked by Simran Parkhe on 16 Sep 2019 at 16:31
Latest activity Edited by Guillaume
on 16 Sep 2019 at 16:47
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 Comments

Sign in to comment.

1 Answer

回答者: Walter Roberson
2019 年 9 月 16 日 16:32
編集済み: Walter Roberson
2019 年 9 月 16 日 16:35
 採用された回答

Pixels.
Or more correctly, memory locations, as the result is used in multiple contexts and makes no attempt to handle multiple color planes.

  1 Comment

Guillaume
on 16 Sep 2019 at 16:47
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')

Sign in to comment.