Good day,
I have a 2D matrix and I am using imagesc to produce the following diagram:
I need to add extra values to the individual pixels like below:
so that I produce something like below:
I have tried googling on pixel addition but i have reached a dead end... ho can I proceede?

답변 (1개)

Image Analyst
Image Analyst 2020년 1월 3일

0 개 추천

Use imerode() to enlarge those black regions by 7 pixels around each black pixel.
kernel = true(3, 3);
kernel(1, 2) = false; % Don't use upper middle one so lower middle pixel doesn't go to black.
output = imerode(binaryImage, kernel);

댓글 수: 2

Allan Miller
Allan Miller 2020년 1월 6일
result.png
This is the result I am getting by using the code you suggested..., did I miss something?
Attach your image and code in a .mat file. Until then, try
imshow(yourMatrix, []);
colormap(gray(256));

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

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

질문:

2020년 1월 3일

댓글:

2020년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by