Adding points in imagesc matrix
5 次查看(过去 30 天)
显示 更早的评论
Good day,
I have a 2D matrix and I am using imagesc to produce the following diagram:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/259649/image.png)
I need to add extra values to the individual pixels like below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/259650/image.png)
so that I produce something like below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/259651/image.png)
I have tried googling on pixel addition but i have reached a dead end... ho can I proceede?
0 个评论
回答(1 个)
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 个评论
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 Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!