Adding points in imagesc matrix

6 ビュー (過去 30 日間)
Allan Miller
Allan Miller 2020 年 1 月 3 日
コメント済み: Image Analyst 2020 年 1 月 6 日
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 日
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?
Image Analyst
Image Analyst 2020 年 1 月 6 日
Attach your image and code in a .mat file. Until then, try
imshow(yourMatrix, []);
colormap(gray(256));

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by