How to insert a disc and centered around the dot?

조회 수: 2 (최근 30일)
Sara
Sara 2020년 2월 10일
댓글: Sara 2020년 2월 10일
Hi,
I have A = zeros(100,100) materix which I added a while pixel (dots) in this zeros materix randomly. I have also another disc materix as follows
disk = strel('disk', 10);
D = disk.Neighborhood;
what I want to do is insert the disc and centered around the pixel ( white pixel)

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 10일
A(appropriate_row:appropriate_row+99, appropriate_column:appropriate_column+99) = ...
A(appropriate_row:appropriate_row+99, appropriate_column:appropriate_column+99) | D;
  댓글 수: 3
Walter Roberson
Walter Roberson 2020년 2월 10일
The +99 should be +9
Protection needs to be added for the case that the location is near an edge.
Sara
Sara 2020년 2월 10일
Thank you for your reply. I did fix this as you says. it should be less than the disc raduis which is 10 in my case.

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

추가 답변 (0개)

카테고리

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