필터 지우기
필터 지우기

regarding masking the image

조회 수: 1 (최근 30일)
Rd
Rd 2020년 7월 21일
이동: DGM 2023년 5월 5일
kindly expalin the following line
mask_h and mask_w are the scalar inputs
mask = zeros(mask_h,mask_w);
mask(1:mask_h/2,:) = -1;
mask(mask_h/2 + 1:end,:) = 1;

채택된 답변

waqas
waqas 2020년 7월 21일
이동: DGM 2023년 5월 5일
First line is defining a zero matrix With mask_h rows and mask_w columns.
In the second line, all the entries in first half of the rows are being assigned a value of -1.
For third line, rest of the rows, i.e., all the entries from half of the rows till the end are assigned a value of 1.
You are using Matlab indexing to assign values of 1 or -1 to the entries based on their location in the matrix.
  댓글 수: 2
Rd
Rd 2020년 7월 21일
이동: DGM 2023년 5월 5일
Thanks a lot.
waqas
waqas 2020년 7월 21일
이동: DGM 2023년 5월 5일
My pleasure. If your query is resolved then I would suggest to accept the answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by