필터 지우기
필터 지우기

How do i transform/convert a structuring element to an binary image in Matlab?

조회 수: 4 (최근 30일)
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

채택된 답변

Jeff E
Jeff E 2013년 11월 11일
>> se = strel('square',7);
>> nhood = getnhood(se);
>> whos('se' ,'nhood')
Name Size Bytes Class Attributes
nhood 7x7 49 logical
se 1x1 112 strel

추가 답변 (1개)

Roro
Roro 2013년 11월 11일
Jeff, how do i make my structuring element to look like the attached image? can you help me with the sintax please ? the se in this case is a disk. I've used the following code lines:
% clear
se=strel('disk',10)
nh=getnhood(se)
p=padarray(nh, [10 10], 0, 'both');
imshow(p)
  댓글 수: 1
Jeff E
Jeff E 2013년 11월 11일
편집: Jeff E 2013년 11월 11일
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//

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by