필터 지우기
필터 지우기

Define origin and length of the Strel function

조회 수: 3 (최근 30일)
Luccas S.
Luccas S. 2022년 2월 22일
댓글: Luccas S. 2022년 2월 22일
I'm trying to create the following structuring element (SE):
The underline bar represents the origin of the SE.
For example, if I want an SE of and with length equal to 3, how could I do it through the strel function?

채택된 답변

DGM
DGM 2022년 2월 22일
No need for strel().
A = false(7);
A(4,4) = true
A = 7×7 logical array
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
st1 = [1 1 1 0 0 ];
B1 = imdilate(A,st1)
B1 = 7×7 logical array
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
st2 = [0 0 1 1 1];
B2 = imdilate(A,st2)
B2 = 7×7 logical array
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  댓글 수: 1
Luccas S.
Luccas S. 2022년 2월 22일
Ok thanks!
If I have a signal formed by a column vector. So I should put st1 and st2 in vector form too, like: st1 = [1; 1; 1; 0; 0] To apply imdilate?

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by